Class HessianSerializerInput

  • All Implemented Interfaces:
    Hessian2Constants

    public class HessianSerializerInput
    extends Hessian2Input
    Input stream for Hessian requests, deserializing objects using the java.io.Serialization protocol.

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

    Serialization

     InputStream is = new FileInputStream("test.xml");
     HessianOutput in = new HessianSerializerOutput(is);
    
     Object obj = in.readObject();
     is.close();
     

    Parsing a Hessian reply

     InputStream is = ...; // from http connection
     HessianInput in = new HessianSerializerInput(is);
     String value;
    
     in.startReply();         // read reply header
     value = in.readString(); // read string value
     in.completeReply();      // read reply footer
     
    • Constructor Detail

      • HessianSerializerInput

        public HessianSerializerInput​(java.io.InputStream is)
        Creates a new Hessian input stream, initialized with an underlying input stream.
        Parameters:
        is - the underlying input stream.
      • HessianSerializerInput

        public HessianSerializerInput()
        Creates an uninitialized Hessian input stream.
    • Method Detail

      • readObjectImpl

        protected java.lang.Object readObjectImpl​(java.lang.Class cl)
                                           throws java.io.IOException
        Reads an object from the input stream. cl is known not to be a Map.
        Throws:
        java.io.IOException
      • getFieldMap

        protected java.util.HashMap getFieldMap​(java.lang.Class cl)
        Creates a map of the classes fields.