public static byte[] serialize(Object value) throws IOException {
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  serialize(value,out);
  return out.toByteArray();
}

public static byte [ ] serialize ( Object value ) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; serialize ( value , out ) ; return out . toByteArray ( ) ; }
serializes the given object value to a newly allocated byte array .
