Class HessianSerializerOutput

  • All Implemented Interfaces:
    Hessian2Constants

    public class HessianSerializerOutput
    extends Hessian2Output
    Output stream for Hessian requests.

    HessianOutput is unbuffered, so any client needs to provide its own buffering.

    Serialization

     OutputStream os = new FileOutputStream("test.xml");
     HessianOutput out = new HessianSerializerOutput(os);
    
     out.writeObject(obj);
     os.close();
     

    Writing an RPC Call

     OutputStream os = ...; // from http connection
     HessianOutput out = new HessianSerializerOutput(os);
     String value;
    
     out.startCall("hello");  // start hello call
     out.writeString("arg1"); // write a string argument
     out.completeCall();      // complete the call
     
    • Constructor Detail

      • HessianSerializerOutput

        public HessianSerializerOutput​(java.io.OutputStream os)
        Creates a new Hessian output stream, initialized with an underlying output stream.
        Parameters:
        os - the underlying output stream.
      • HessianSerializerOutput

        public HessianSerializerOutput()
        Creates an uninitialized Hessian output stream.
    • Method Detail

      • writeObjectImpl

        public void writeObjectImpl​(java.lang.Object obj)
                             throws java.io.IOException
        Applications which override this can do custom serialization.
        Parameters:
        object - the object to write.
        Throws:
        java.io.IOException