public static byte[] getBytes(Object obj) throws java.io.IOException {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(obj);
oos.flush();
oos.close();
bos.close();
byte[] data = bos.toByteArray();
return data;
}
but does the object need to be serializable? if yes, its not a secure
approach.
Original issue reported on code.google.com by brito....@gmail.com on 31 Mar 2010 at 8:18
Original issue reported on code.google.com by
brito....@gmail.com
on 31 Mar 2010 at 8:18