com.caucho.hessian.io

Class HessianSerializerInput


public class HessianSerializerInput
extends HessianInput

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
 

Field Summary

Fields inherited from class com.caucho.hessian.io.HessianInput

END_OF_DATA, _chunkInputStream, _chunkLength, _chunkReader, _detailMessageField, _is, _isLastChunk, _method, _peek, _refs, _replyFault, _serializerFactory

Fields inherited from class com.caucho.hessian.io.AbstractHessianInput

resolver

Constructor Summary

HessianSerializerInput()
Creates an uninitialized Hessian input stream.
HessianSerializerInput(InputStream is)
Creates a new Hessian input stream, initialized with an underlying input stream.

Method Summary

protected HashMap
getFieldMap(Class cl)
Creates a map of the classes fields.
protected Object
readObjectImpl(Class cl)
Reads an object from the input stream.

Methods inherited from class com.caucho.hessian.io.HessianInput

addRef, completeCall, completeReply, completeValueReply, error, expect, getMethod, getReader, getReplyFault, getSerializerFactory, init, isEnd, parseByte, parseChar, parseDouble, parseInt, parseLong, parseUTF8Char, parseXML, prepareFault, read, read, readBoolean, readByte, readBytes, readBytes, readCall, readChar, readDouble, readEnd, readFault, readFloat, readHeader, readInputStream, readInt, readLength, readListEnd, readListStart, readLong, readMapEnd, readMapStart, readMethod, readNode, readNull, readObject, readObject, readRef, readRemote, readReply, readShort, readString, readString, readType, readUTCDate, resolveRemote, setRef, setSerializerFactory, startCall, startReply

Methods inherited from class com.caucho.hessian.io.AbstractHessianInput

addRef, completeCall, completeReply, getMethod, getReader, getRemoteResolver, init, isEnd, readBoolean, readBytes, readDouble, readEnd, readInputStream, readInt, readLength, readListEnd, readListStart, readLong, readMapEnd, readMapStart, readNode, readNull, readObject, readObject, readRef, readRemote, readReply, readString, readType, readUTCDate, setRef, setRemoteResolver, startCall, startReply

Constructor Details

HessianSerializerInput

public HessianSerializerInput()
Creates an uninitialized Hessian input stream.

HessianSerializerInput

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

Method Details

getFieldMap

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

readObjectImpl

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