public static < T extends Serializable > byte [ ] serializeObject ( T object ) throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream ( ) ; ObjectOutputStream out = new ObjectOutputStream ( os ) ; out . writeObject ( object ) ; return os . toByteArray ( ) ; }
Serializes an object .