question: public static byte [ ] serializeAsByteArray ( Object b ) throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; ObjectOutputStream out = new ObjectOutputStream ( bos ) ; try { out . writeObject ( b ) ; } finally { out . close ( ) ; } return bos . toByteArray ( ) ; }
target:  Serialize an object as a raw byte array