code: public <T> ByteArrayOutputStream toAmf(final T source) throws IOException
  	{
  		// Create and instance of the byte array output stream to write the AMF3
  		// object to.
  		final ByteArrayOutputStream bout = new ByteArrayOutputStream();
  		// Create the AMF3Output object and set its output stream.
  		final Amf3Output amf3Output = new Amf3Output(context);
  		amf3Output.setOutputStream(bout);
  		// Write the AMF3 object to the byte array output stream after
  		// converting the source java object.
  		amf3Output.writeObject(source);
  		// Flush and close the stream.
  		amf3Output.flush();
  		amf3Output.close();
  		return bout;
  	}
docs: Method used to convert the java object to AMF3 format. This method in
  turn delegates this conversion to the blazeds class AMF3 output.
  
  @param <T>
  @param source
  This is the java object that is to be converted to AMF3.
  @return Returns the byte array output stream which was created by
  serializing a java object to AMF3.
  @throws IOException