public class HessianInput extends AbstractHessianInput
HessianInput is unbuffered, so any client needs to provide its own buffering.
InputStream is = ...; // from http connection HessianInput in = new HessianInput(is); String value; in.startReply(); // read reply header value = in.readString(); // read string value in.completeReply(); // read reply footer
Modifier and Type | Field and Description |
---|---|
protected int |
_peek |
protected ArrayList |
_refs |
protected SerializerFactory |
_serializerFactory |
Constructor and Description |
---|
HessianInput()
Creates an uninitialized Hessian input stream.
|
HessianInput(InputStream is)
Creates a new Hessian input stream, initialized with an
underlying input stream.
|
Modifier and Type | Method and Description |
---|---|
int |
addRef(Object ref)
Adds a list/map reference.
|
void |
close() |
protected String |
codeName(int ch) |
void |
completeCall()
Completes reading the call
|
void |
completeReply()
Completes reading the call
|
void |
completeValueReply()
Completes reading the call
|
protected IOException |
error(String message) |
protected IOException |
expect(String expect,
int ch) |
String |
getMethod()
Returns the calls method
|
Reader |
getReader()
Starts reading a string.
|
Throwable |
getReplyFault()
Returns any reply fault.
|
SerializerFactory |
getSerializerFactory()
Gets the serializer factory.
|
void |
init(InputStream is)
Initialize the hessian stream with the underlying input stream.
|
boolean |
isEnd()
Returns true if this is the end of a list or a map.
|
boolean |
readBoolean()
Reads a boolean
|
int |
readByte()
Reads a byte from the stream.
|
byte[] |
readBytes()
Reads a byte array
|
int |
readBytes(byte[] buffer,
int offset,
int length)
Reads a byte array from the stream.
|
int |
readCall()
Starts reading the call
|
int |
readChar()
Reads a byte from the stream.
|
double |
readDouble()
Reads a double
|
void |
readEnd()
Reads the end byte.
|
float |
readFloat()
Reads a float
|
String |
readHeader()
Reads a header, returning null if there are no headers.
|
InputStream |
readInputStream()
Reads bytes based on an input stream.
|
int |
readInt()
Reads an integer
|
int |
readLength()
Parses the length for an array
|
void |
readListEnd()
Reads the end byte.
|
int |
readListStart()
Reads the start of a list.
|
long |
readLong()
Reads a long
|
void |
readMapEnd()
Reads the end byte.
|
int |
readMapStart()
Reads the start of a list.
|
String |
readMethod()
Starts reading the call
|
Node |
readNode()
Reads an XML node.
|
void |
readNull()
Reads a null
|
Object |
readObject()
Reads an arbitrary object from the input stream when the type
is unknown.
|
Object |
readObject(Class cl)
Reads an object from the input stream with an expected type.
|
Object |
readRef()
Reads a reference.
|
Object |
readRemote()
Reads a remote object.
|
Object |
readReply(Class expectedClass)
Reads a reply as an object.
|
short |
readShort()
Reads a short
|
String |
readString()
Reads a string
|
int |
readString(char[] buffer,
int offset,
int length)
Reads a byte array from the stream.
|
String |
readType()
Parses a type from the stream.
|
long |
readUTCDate()
Reads a date.
|
void |
resetReferences()
Resets the references for streaming.
|
Object |
resolveRemote(String type,
String url)
Resolves a remote object.
|
void |
setRef(int i,
Object ref)
Adds a list/map reference.
|
void |
setSerializerFactory(SerializerFactory factory)
Sets the serializer factory.
|
void |
skipOptionalCall()
For backward compatibility with HessianSkeleton
|
void |
startCall()
Starts reading the call, including the headers.
|
void |
startReply()
Starts reading the reply
|
void |
startReplyBody()
Starts reading the body of the reply, i.e.
|
getRemoteResolver, readMethodArgLength, readToOutputStream, setRemoteResolver
protected SerializerFactory _serializerFactory
protected ArrayList _refs
protected int _peek
public HessianInput()
public HessianInput(InputStream is)
is
- the underlying input stream.public void setSerializerFactory(SerializerFactory factory)
setSerializerFactory
in class AbstractHessianInput
public SerializerFactory getSerializerFactory()
public void init(InputStream is)
init
in class AbstractHessianInput
public String getMethod()
getMethod
in class AbstractHessianInput
public Throwable getReplyFault()
public int readCall() throws IOException
c major minor
readCall
in class AbstractHessianInput
IOException
public void skipOptionalCall() throws IOException
skipOptionalCall
in class AbstractHessianInput
IOException
public String readMethod() throws IOException
A successful completion will have a single value:
m b16 b8 method
readMethod
in class AbstractHessianInput
IOException
public void startCall() throws IOException
The call expects the following protocol data
c major minor m b16 b8 method
startCall
in class AbstractHessianInput
IOException
public void completeCall() throws IOException
A successful completion will have a single value:
z
completeCall
in class AbstractHessianInput
IOException
public Object readReply(Class expectedClass) throws Throwable
readReply
in class AbstractHessianInput
Throwable
public void startReply() throws Throwable
A successful completion will have a single value:
r
startReply
in class AbstractHessianInput
Throwable
public void startReplyBody() throws Throwable
AbstractHessianInput
startReplyBody
in class AbstractHessianInput
Throwable
public void completeReply() throws IOException
A successful completion will have a single value:
z
completeReply
in class AbstractHessianInput
IOException
public void completeValueReply() throws IOException
A successful completion will have a single value:
z
IOException
public String readHeader() throws IOException
H b16 b8 value
readHeader
in class AbstractHessianInput
IOException
public void readNull() throws IOException
N
readNull
in class AbstractHessianInput
IOException
public boolean readBoolean() throws IOException
T F
readBoolean
in class AbstractHessianInput
IOException
public short readShort() throws IOException
I b32 b24 b16 b8
IOException
public int readInt() throws IOException
I b32 b24 b16 b8
readInt
in class AbstractHessianInput
IOException
public long readLong() throws IOException
L b64 b56 b48 b40 b32 b24 b16 b8
readLong
in class AbstractHessianInput
IOException
public float readFloat() throws IOException
D b64 b56 b48 b40 b32 b24 b16 b8
IOException
public double readDouble() throws IOException
D b64 b56 b48 b40 b32 b24 b16 b8
readDouble
in class AbstractHessianInput
IOException
public long readUTCDate() throws IOException
T b64 b56 b48 b40 b32 b24 b16 b8
readUTCDate
in class AbstractHessianInput
IOException
public int readChar() throws IOException
IOException
public int readString(char[] buffer, int offset, int length) throws IOException
IOException
public String readString() throws IOException
S b16 b8 string value
readString
in class AbstractHessianInput
IOException
public Node readNode() throws IOException
S b16 b8 string value
readNode
in class AbstractHessianInput
IOException
public byte[] readBytes() throws IOException
B b16 b8 data value
readBytes
in class AbstractHessianInput
IOException
public int readByte() throws IOException
IOException
public int readBytes(byte[] buffer, int offset, int length) throws IOException
IOException
public Object readObject(Class cl) throws IOException
readObject
in class AbstractHessianInput
cl
- the expected class if the protocol doesn't supply it.IOException
public Object readObject() throws IOException
readObject
in class AbstractHessianInput
IOException
public Object readRemote() throws IOException
readRemote
in class AbstractHessianInput
IOException
public Object readRef() throws IOException
readRef
in class AbstractHessianInput
IOException
public int readListStart() throws IOException
readListStart
in class AbstractHessianInput
IOException
public int readMapStart() throws IOException
readMapStart
in class AbstractHessianInput
IOException
public boolean isEnd() throws IOException
isEnd
in class AbstractHessianInput
IOException
public void readEnd() throws IOException
readEnd
in class AbstractHessianInput
IOException
public void readMapEnd() throws IOException
readMapEnd
in class AbstractHessianInput
IOException
public void readListEnd() throws IOException
readListEnd
in class AbstractHessianInput
IOException
public int addRef(Object ref)
addRef
in class AbstractHessianInput
public void setRef(int i, Object ref)
setRef
in class AbstractHessianInput
public void resetReferences()
resetReferences
in class AbstractHessianInput
public Object resolveRemote(String type, String url) throws IOException
IOException
public String readType() throws IOException
t b16 b8
readType
in class AbstractHessianInput
IOException
public int readLength() throws IOException
l b32 b24 b16 b8
readLength
in class AbstractHessianInput
IOException
public InputStream readInputStream() throws IOException
readInputStream
in class AbstractHessianInput
IOException
public void close()
close
in class AbstractHessianInput
public Reader getReader()
AbstractHessianInput
s b16 b8 non-final string chunk S b16 b8 final string chunk
getReader
in class AbstractHessianInput
protected IOException expect(String expect, int ch)
protected String codeName(int ch)
protected IOException error(String message)
Copyright © 2023. All rights reserved.