/ Published in: Java
From time to time, coders must convert an object to a stream of bytes. The following method accomplishes this task.
Expand |
Embed | Plain Text
{ os.flush(); os.writeObject(obj); os.flush(); byte[] sendBuf = byteStream.toByteArray(); os.close(); return sendBuf; }
You need to login to post a comment.
