Package flex.messaging.io.amf

Examples of flex.messaging.io.amf.Amf3Output.writeObject()


    // 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;
  }
View Full Code Here


        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        DataOutputStream dataOutStream = new DataOutputStream(outStream);
        amfOut.setOutputStream(dataOutStream);     
        try
        {
            amfOut.writeObject(message);
        }
        catch (IOException e)
        {
            if (Log.isDebug())
                log.debug("MPI exception while retrieving the size of the serialized message: " + e.toString());             
View Full Code Here

                addPerformanceInfo(message);
           
            if (Log.isDebug())
                log.debug("Endpoint with id '" + getId() + "' is streaming message: " + message);
                       
            amfOut.writeObject(message);
            dataOutStream.flush();
            byte[] messageBytes = outStream.toByteArray();
            streamChunk(messageBytes, os, response);
           
            // Update the push count for the StreamingEndpoint mbean.
View Full Code Here

    {
      DeflaterOutputStream deflaterOutputStream = new DeflaterOutputStream(servletOutputStream);
     
      Amf3Output amf3Output = new Amf3Output(serializationContext);
      amf3Output.setOutputStream(deflaterOutputStream); // compress
      amf3Output.writeObject(objToSerialize);
      amf3Output.flush();
     
      deflaterOutputStream.close(); // this is necessary to finish the compression
     
      /*
 
View Full Code Here

      testBean.setString("test");
*/     
      ByteArrayOutputStream bout = new ByteArrayOutputStream();
      Amf3Output amf3Output = new Amf3Output(context);
      amf3Output.setOutputStream(bout);
      amf3Output.writeObject("hello world");
      amf3Output.flush();
      amf3Output.close();
      
      InputStream bIn = new ByteArrayInputStream(bout.toByteArray());
      Amf3Input amf3Input = new Amf3Input(context);
View Full Code Here

  public void writeTo(Object obj, Class realType, Type genericType, OutputStream stream) throws IOException {
    AMFMapper mapper = AMFMapperIntrospector.getAMFMapper(realType, genericType);
    SerializationContext context = new SerializationContext();
    Amf3Output output = new Amf3Output(context);
    output.setOutputStream(stream);
    output.writeObject(mapper.toAMF(obj, new AMFMappingContext()));
  }
}
View Full Code Here

        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        DataOutputStream dataOutStream = new DataOutputStream(outStream);
        amfOut.setOutputStream(dataOutStream);     
        try
        {
            amfOut.writeObject(message);
        }
        catch (IOException e)
        {
            if (Log.isDebug())
                log.debug("MPI exception while retrieving the size of the serialized message: " + e.toString());             
View Full Code Here

                addPerformanceInfo(message);
           
            if (Log.isDebug())
                log.debug("Endpoint with id '" + getId() + "' is streaming message: " + message);
                       
            amfOut.writeObject(message);
            dataOutStream.flush();
            byte[] messageBytes = outStream.toByteArray();              
            streamChunk(messageBytes, os, response);
           
            // Update the push count for the StreamingEndpoint mbean.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.