protected byte [ ] serializeObject ( Serializable theObject ) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; ObjectOutputStream oout = new ObjectOutputStream ( baos ) ; oout . writeObject ( theObject ) ; byte [ ] data = baos . toByteArray ( ) ; baos . close ( ) ; oout . close ( ) ; return data ; }
This method is used to serialized an object saved into a table BLOB field .