public static AbstractMessage unserializeFrom ( RawDataBuffer rawIn , boolean asInternalCopy ) { int size = rawIn . readInt ( ) ; // Extract a sub buffer RawDataBuffer rawMessage = new RawDataBuffer ( rawIn . readBytes ( size ) ) ; byte type = rawMessage . readByte ( ) ; AbstractMessage message = MessageType . createInstance ( type ) ; message . initializeFromRaw ( rawMessage ) ; if ( asInternalCopy ) message . setInternalCopy ( true ) ; return message ; }
Unserialize a message from the given input stream