public Object fromStream(final byte[] iStream) throws IOException {
		if (iStream == null || iStream.length == 0)
			// NULL VALUE
			return null;

		final int classNameSize = OBinaryProtocol.bytes2int(iStream);
		if (classNameSize <= 0)
			OLogManager.instance().error(this, "Class signature not found in ANY element: " + Arrays.toString(iStream),
					OSerializationException.class);

		final String className = OBinaryProtocol.bytes2string(iStream, 4, classNameSize);

		try {
			final OSerializableStream stream;
			// CHECK FOR ALIASES
			if (className.equalsIgnoreCase("q"))
				// QUERY
				stream = new OSQLSynchQuery<Object>();
			else if (className.equalsIgnoreCase("c"))
				// SQL COMMAND
				stream = new OCommandSQL();
			else if (className.equalsIgnoreCase("s"))
				// SCRIPT COMMAND
				stream = new OCommandScript();
			else
				// CREATE THE OBJECT BY INVOKING THE EMPTY CONSTRUCTOR
				stream = (OSerializableStream) Class.forName(className).newInstance();

			return stream.fromStream(OArrays.copyOfRange(iStream, 4 + classNameSize, iStream.length));

		} catch (Exception e) {
			OLogManager.instance().error(this, "Error on unmarshalling content. Class: " + className, e, OSerializationException.class);
		}
		return null;
	}
public Object fromStream ( final byte [ ] iStream ) throws IOException { if ( iStream == null || iStream . length == 0 ) return null ; final int classNameSize = OBinaryProtocol . bytes2int ( iStream ) ; if ( classNameSize <= 0 ) OLogManager . instance ( ) . error ( this , "Class signature not found in ANY element: " + Arrays . toString ( iStream ) , OSerializationException . class ) ; final String className = OBinaryProtocol . bytes2string ( iStream , 4 , classNameSize ) ; try { final OSerializableStream stream ; if ( className . equalsIgnoreCase ( "q" ) ) stream = new OSQLSynchQuery < Object > ( ) ; else if ( className . equalsIgnoreCase ( "c" ) ) stream = new OCommandSQL ( ) ; else if ( className . equalsIgnoreCase ( "s" ) ) stream = new OCommandScript ( ) ; else stream = ( OSerializableStream ) Class . forName ( className ) . newInstance ( ) ; return stream . fromStream ( OArrays . copyOfRange ( iStream , 4 + classNameSize , iStream . length ) ) ; } catch ( Exception e ) { OLogManager . instance ( ) . error ( this , "Error on unmarshalling content. Class: " + className , e , OSerializationException . class ) ; } return null ; }
Re-Create any object if the class has a public constructor that accepts a String as unique parameter.