Package com.caucho.hessian.io
Class AbstractHessianInput
java.lang.Object
com.caucho.hessian.io.AbstractHessianInput
- Direct Known Subclasses:
AbstractBurlapInput
,Hessian2Input
,HessianInput
Abstract base class for Hessian requests. Hessian users should only
need to use the methods in this class.
AbstractHessianInput in = ...; // get input String value; in.startReply(); // read reply header value = in.readString(); // read string value in.completeReply(); // read reply footer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract int
Adds an object reference.void
close()
abstract void
Completes reading the callabstract void
Completes reading the callabstract String
Returns the call's methodabstract Reader
Starts reading a string.Sets the resolver used to lookup remote objects.void
init
(InputStream is) Initialize the Hessian stream with the underlying input stream.abstract boolean
isEnd()
Returns true if the data has ended.abstract boolean
Reads a booleanabstract byte[]
Reads a byte array.abstract int
readCall()
Reads the callabstract double
Reads a double.abstract void
readEnd()
Read the end byteabstract String
Reads a header, returning null if there are no headers.abstract InputStream
Starts reading a byte array using an input stream.abstract int
readInt()
Reads an integerabstract int
Reads the length of a list.abstract void
Read the end byteabstract int
Reads the start of a listabstract long
readLong()
Reads a longabstract void
Read the end byteabstract int
Reads the start of a mapabstract String
Starts reading the callint
Reads the number of method argumentsreadNode()
Reads an XML node encoded in UTF-8abstract void
readNull()
Reads a nullabstract Object
Reads an arbitrary object from the input stream.abstract Object
readObject
(Class expectedClass) Reads an arbitrary object from the input stream.abstract Object
readRef()
Reads a referenceabstract Object
Reads a remote object reference to the stream.abstract Object
Reads a reply as an object.abstract String
Reads a string encoded in UTF-8boolean
Reads data to an output stream.abstract String
readType()
Reads an object type.abstract long
Reads a date.void
Resets the references for streaming.abstract void
Sets an object reference.void
setRemoteResolver
(HessianRemoteResolver resolver) Sets the resolver used to lookup remote objects.void
Sets the serializer factory.void
For backward compatibility with HessianSkeletonabstract void
Starts reading the call, including the headers.abstract void
Starts reading the replyvoid
Starts reading the body of the reply, i.e.
-
Constructor Details
-
AbstractHessianInput
public AbstractHessianInput()
-
-
Method Details
-
init
Initialize the Hessian stream with the underlying input stream. -
getMethod
Returns the call's method -
setRemoteResolver
Sets the resolver used to lookup remote objects. -
getRemoteResolver
Sets the resolver used to lookup remote objects. -
setSerializerFactory
Sets the serializer factory. -
readCall
Reads the callc major minor
- Throws:
IOException
-
skipOptionalCall
For backward compatibility with HessianSkeleton- Throws:
IOException
-
readHeader
Reads a header, returning null if there are no headers.H b16 b8 value
- Throws:
IOException
-
readMethod
Starts reading the callA successful completion will have a single value:
m b16 b8 method
- Throws:
IOException
-
readMethodArgLength
Reads the number of method arguments- Returns:
- -1 for a variable length (hessian 1.0)
- Throws:
IOException
-
startCall
Starts reading the call, including the headers.The call expects the following protocol data
c major minor m b16 b8 method
- Throws:
IOException
-
completeCall
Completes reading the callThe call expects the following protocol data
Z
- Throws:
IOException
-
readReply
Reads a reply as an object. If the reply has a fault, throws the exception.- Throws:
Throwable
-
startReply
Starts reading the replyA successful completion will have a single value:
r v
- Throws:
Throwable
-
startReplyBody
Starts reading the body of the reply, i.e. after the 'r' has been parsed.- Throws:
Throwable
-
completeReply
Completes reading the callA successful completion will have a single value:
z
- Throws:
IOException
-
readBoolean
Reads a booleanT F
- Throws:
IOException
-
readNull
Reads a nullN
- Throws:
IOException
-
readInt
Reads an integerI b32 b24 b16 b8
- Throws:
IOException
-
readLong
Reads a longL b64 b56 b48 b40 b32 b24 b16 b8
- Throws:
IOException
-
readDouble
Reads a double.D b64 b56 b48 b40 b32 b24 b16 b8
- Throws:
IOException
-
readUTCDate
Reads a date.T b64 b56 b48 b40 b32 b24 b16 b8
- Throws:
IOException
-
readString
Reads a string encoded in UTF-8s b16 b8 non-final string chunk S b16 b8 final string chunk
- Throws:
IOException
-
readNode
Reads an XML node encoded in UTF-8x b16 b8 non-final xml chunk X b16 b8 final xml chunk
- Throws:
IOException
-
getReader
Starts reading a string. All the characters must be read before calling the next method. The actual characters will be read with the reader's read() or read(char [], int, int).s b16 b8 non-final string chunk S b16 b8 final string chunk
- Throws:
IOException
-
readInputStream
Starts reading a byte array using an input stream. All the bytes must be read before calling the following method.b b16 b8 non-final binary chunk B b16 b8 final binary chunk
- Throws:
IOException
-
readToOutputStream
Reads data to an output stream.b b16 b8 non-final binary chunk B b16 b8 final binary chunk
- Throws:
IOException
-
readBytes
Reads a byte array.b b16 b8 non-final binary chunk B b16 b8 final binary chunk
- Throws:
IOException
-
readObject
Reads an arbitrary object from the input stream.- Parameters:
expectedClass
- the expected class if the protocol doesn't supply it.- Throws:
IOException
-
readObject
Reads an arbitrary object from the input stream.- Throws:
IOException
-
readRemote
Reads a remote object reference to the stream. The type is the type of the remote interface.'r' 't' b16 b8 type url
- Throws:
IOException
-
readRef
Reads a referenceR b32 b24 b16 b8
- Throws:
IOException
-
addRef
Adds an object reference.- Throws:
IOException
-
setRef
Sets an object reference.- Throws:
IOException
-
resetReferences
public void resetReferences()Resets the references for streaming. -
readListStart
Reads the start of a list- Throws:
IOException
-
readLength
Reads the length of a list.- Throws:
IOException
-
readMapStart
Reads the start of a map- Throws:
IOException
-
readType
Reads an object type.- Throws:
IOException
-
isEnd
Returns true if the data has ended.- Throws:
IOException
-
readEnd
Read the end byte- Throws:
IOException
-
readMapEnd
Read the end byte- Throws:
IOException
-
readListEnd
Read the end byte- Throws:
IOException
-
close
- Throws:
IOException
-