code: public byte[] serialize(Serializable value) 
          throws IOException {
          
          // create buffer and underlying output stream
          ByteArrayOutputStream buffer = new ByteArrayOutputStream(1024);
          ObjectOutputStream output = new ObjectOutputStream(buffer);
          
          // write the serialized value
          try { output.writeObject(value); }
          finally { buffer.close(); }
          
          // return the underlying bytes
          return buffer.toByteArray();
      }
docs: Serialize the given value into an array of bytes.  This uses the standard
  Java-based serializers ({@link ObjectOutputStream}) to serialize the
  data.
  
  @param value The value to serialize
  
  @return The array of bytes representing the serialized form of the value
  
  @throws IOException if an error occurs during serialization
  
  @see #deserialize(byte[])
  @see #serializeBase64(Serializable)