类 HessianSerializerOutput


  • public class HessianSerializerOutput
    extends HessianOutput
    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
     
    • 构造器详细资料

      • HessianSerializerOutput

        public HessianSerializerOutput​( os)
        Creates a new Hessian output stream, initialized with an underlying output stream.
        参数:
        os - the underlying output stream.
      • HessianSerializerOutput

        public HessianSerializerOutput()
        Creates an uninitialized Hessian output stream.
    • 方法详细资料

      • writeObjectImpl

        public void writeObjectImpl​( obj)
                             throws 
        Applications which override this can do custom serialization.
        参数:
        object - the object to write.
        抛出: