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 Details

    • HessianSerializerInput

      public HessianSerializerInput(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 Details

    • readObjectImpl

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

      protected HashMap getFieldMap(Class cl)
      Creates a map of the classes fields.