docs: public void write( Object object,
                         DataOutput output ) throws IOException {
          ByteArrayOutputStream stream = new ByteArrayOutputStream();
          write(object, stream);
          stream.flush();
          byte[] bytes = stream.toByteArray();
          output.write(bytes);
      }