How to store a Java object into a byte array

ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
ObjectOutputStream objectStream = new ObjectOutputStream(byteStream);
objectStream.writeObject(theObject);
byte[] array = byteStream.toByteArray();
This entry was posted in Developer. Bookmark the permalink.

One Response to How to store a Java object into a byte array