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 ; }
Method used to convert the java object to AMF3 format . This method in turn delegates this conversion to the blazeds class AMF3 output .