code: 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;
      }
docs: This method is used to serialized an object saved into a table BLOB field.
  
  @param theObject the object to be serialized
  @return a object byte array
  @throws IOException