question: protected byte [ ] writeExternalFormToBytes ( Serializable o ) throws IOException { ByteArrayOutputStream byteStream = new ByteArrayOutputStream ( ) ; writeExternalFormToStream ( o , byteStream ) ; return byteStream . toByteArray ( ) ; }
target:  Converts a Serializable or Externalizable object to bytes. Useful for in-memory tests of serialization