public class Hessian2Input extends AbstractHessianInput implements Hessian2Constants
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
BC_BINARY, BC_BINARY_CHUNK, BC_BINARY_DIRECT, BC_BINARY_SHORT, BC_CLASS_DEF, BC_DATE, BC_DATE_MINUTE, BC_DOUBLE, BC_DOUBLE_BYTE, BC_DOUBLE_MILL, BC_DOUBLE_ONE, BC_DOUBLE_SHORT, BC_DOUBLE_ZERO, BC_END, BC_FALSE, BC_INT, BC_INT_BYTE_ZERO, BC_INT_SHORT_ZERO, BC_INT_ZERO, BC_LIST_DIRECT, BC_LIST_DIRECT_UNTYPED, BC_LIST_FIXED, BC_LIST_FIXED_UNTYPED, BC_LIST_VARIABLE, BC_LIST_VARIABLE_UNTYPED, BC_LONG, BC_LONG_BYTE_ZERO, BC_LONG_INT, BC_LONG_SHORT_ZERO, BC_LONG_ZERO, BC_MAP, BC_MAP_UNTYPED, BC_NULL, BC_OBJECT, BC_OBJECT_DEF, BC_OBJECT_DIRECT, BC_REF, BC_STRING, BC_STRING_CHUNK, BC_STRING_DIRECT, BC_STRING_SHORT, BC_TRUE, BINARY_DIRECT_MAX, BINARY_SHORT_MAX, INT_BYTE_MAX, INT_BYTE_MIN, INT_DIRECT_MAX, INT_DIRECT_MIN, INT_SHORT_MAX, INT_SHORT_MIN, LIST_DIRECT_MAX, LONG_BYTE_MAX, LONG_BYTE_MIN, LONG_DIRECT_MAX, LONG_DIRECT_MIN, LONG_SHORT_MAX, LONG_SHORT_MIN, OBJECT_DIRECT_MAX, P_PACKET, P_PACKET_CHUNK, P_PACKET_DIRECT, P_PACKET_SHORT, PACKET_DIRECT_MAX, PACKET_SHORT_MAX, STRING_DIRECT_MAX, STRING_SHORT_MAX| 构造器和说明 |
|---|
Hessian2Input(InputStream is)
Creates a new Hessian input stream, initialized with an
underlying input stream.
|
| 限定符和类型 | 方法和说明 |
|---|---|
int |
addRef(Object ref)
Adds a list/map reference.
|
void |
allow(String pattern) |
boolean |
checkAndReadNull() |
void |
close() |
void |
completeCall()
Completes reading the call
A successful completion will have a single value:
|
void |
completeEnvelope()
Completes reading the envelope
A successful completion will have a single value:
Z
|
void |
completeMessage()
Completes reading the message
A successful completion will have a single value:
z
|
void |
completeReply()
Completes reading the call
A successful completion will have a single value:
z
|
void |
completeValueReply()
Completes reading the call
A successful completion will have a single value:
z
|
void |
free() |
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.
|
void |
initPacket(InputStream is) |
boolean |
isCloseStreamOnClose() |
boolean |
isEnd()
Returns true if this is the end of a list or a map.
|
int |
read()
Normally, shouldn't be called externally, but needed for QA, e.g.
|
Object[] |
readArguments() |
boolean |
readBoolean()
Reads a boolean
T
F
|
int |
readByte()
Reads a byte from the stream.
|
byte[] |
readBytes()
Reads a byte array
B b16 b8 data value
|
int |
readBytes(byte[] buffer,
int offset,
int length)
Reads a byte array from the stream.
|
int |
readCall()
Starts reading the call
c major minor
|
int |
readChar()
Reads a byte from the stream.
|
double |
readDouble()
Reads a double
D b64 b56 b48 b40 b32 b24 b16 b8
|
void |
readEnd()
Reads the end byte.
|
int |
readEnvelope()
Starts reading the envelope
E major minor
|
float |
readFloat()
Reads a float
D b64 b56 b48 b40 b32 b24 b16 b8
|
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
I b32 b24 b16 b8
|
int |
readLength()
Parses the length for an array
l b32 b24 b16 b8
|
void |
readListEnd()
Reads the end byte.
|
int |
readListStart()
Reads the start of a list.
|
long |
readLong()
Reads a long
L b64 b56 b48 b40 b32 b24 b16 b8
|
void |
readMapEnd()
Reads the end byte.
|
int |
readMapStart()
Reads the start of a list.
|
String |
readMethod()
Starts reading the call
A successful completion will have a single value:
string
|
int |
readMethodArgLength()
Returns the number of method arguments
int
|
void |
readNull()
Reads a null
N
|
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 |
readObject(Class cl,
Class<?>... expectedTypes)
Reads an arbitrary object from the input stream.
|
Object |
readObject(List<Class<?>> expectedTypes)
Reads an arbitrary object from the input stream.
|
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
I b32 b24 b16 b8
|
Object |
readStreamingObject() |
String |
readString()
Reads a string
S b16 b8 string value
|
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 |
reset() |
void |
resetBuffer() |
void |
resetReferences()
Resets the references for streaming.
|
Object |
resolveRemote(String type,
String url)
Resolves a remote object.
|
void |
setCloseStreamOnClose(boolean isClose) |
void |
setRef(int i,
Object ref)
Adds a list/map reference.
|
void |
setSerializerFactory(SerializerFactory factory)
Sets the serializer factory.
|
void |
startCall()
Starts reading the call, including the headers.
|
int |
startMessage()
Starts reading a packet
p major minor
|
void |
startReply()
Starts reading the reply
A successful completion will have a single value:
r
|
getRemoteResolver, readNode, readToOutputStream, setRemoteResolver, skipOptionalCall, startReplyBodypublic Hessian2Input(InputStream is)
is - the underlying input stream.public SerializerFactory getSerializerFactory()
public void setSerializerFactory(SerializerFactory factory)
public void allow(String pattern)
public boolean isCloseStreamOnClose()
public void setCloseStreamOnClose(boolean isClose)
public String getMethod()
getMethod 在类中 AbstractHessianInputpublic Throwable getReplyFault()
public void init(InputStream is)
AbstractHessianInputinit 在类中 AbstractHessianInputpublic void initPacket(InputStream is)
public int readCall()
throws IOException
c major minor
readCall 在类中 AbstractHessianInputIOExceptionpublic int readEnvelope()
throws IOException
E major minor
IOExceptionpublic void completeEnvelope()
throws IOException
A successful completion will have a single value:
Z
IOExceptionpublic String readMethod() throws IOException
A successful completion will have a single value:
string
readMethod 在类中 AbstractHessianInputIOExceptionpublic int readMethodArgLength()
throws IOException
int
readMethodArgLength 在类中 AbstractHessianInputIOExceptionpublic void startCall()
throws IOException
The call expects the following protocol data
c major minor m b16 b8 method
startCall 在类中 AbstractHessianInputIOExceptionpublic Object[] readArguments() throws IOException
IOExceptionpublic void completeCall()
throws IOException
A successful completion will have a single value:
completeCall 在类中 AbstractHessianInputIOExceptionpublic Object readReply(Class expectedClass) throws Throwable
readReply 在类中 AbstractHessianInputThrowablepublic void startReply()
throws Throwable
A successful completion will have a single value:
r
startReply 在类中 AbstractHessianInputThrowablepublic void completeReply()
throws IOException
A successful completion will have a single value:
z
completeReply 在类中 AbstractHessianInputIOExceptionpublic void completeValueReply()
throws IOException
A successful completion will have a single value:
z
IOExceptionpublic String readHeader() throws IOException
H b16 b8 value
readHeader 在类中 AbstractHessianInputIOExceptionpublic int startMessage()
throws IOException
p major minor
IOExceptionpublic void completeMessage()
throws IOException
A successful completion will have a single value:
z
IOExceptionpublic void readNull()
throws IOException
N
readNull 在类中 AbstractHessianInputIOExceptionpublic boolean readBoolean()
throws IOException
T F
readBoolean 在类中 AbstractHessianInputIOExceptionpublic short readShort()
throws IOException
I b32 b24 b16 b8
IOExceptionpublic final int readInt()
throws IOException
I b32 b24 b16 b8
readInt 在类中 AbstractHessianInputIOExceptionpublic long readLong()
throws IOException
L b64 b56 b48 b40 b32 b24 b16 b8
readLong 在类中 AbstractHessianInputIOExceptionpublic float readFloat()
throws IOException
D b64 b56 b48 b40 b32 b24 b16 b8
IOExceptionpublic double readDouble()
throws IOException
D b64 b56 b48 b40 b32 b24 b16 b8
readDouble 在类中 AbstractHessianInputIOExceptionpublic long readUTCDate()
throws IOException
T b64 b56 b48 b40 b32 b24 b16 b8
readUTCDate 在类中 AbstractHessianInputIOExceptionpublic int readChar()
throws IOException
IOExceptionpublic int readString(char[] buffer,
int offset,
int length)
throws IOException
IOExceptionpublic String readString() throws IOException
S b16 b8 string value
readString 在类中 AbstractHessianInputIOExceptionpublic byte[] readBytes()
throws IOException
B b16 b8 data value
readBytes 在类中 AbstractHessianInputIOExceptionpublic int readByte()
throws IOException
IOExceptionpublic int readBytes(byte[] buffer,
int offset,
int length)
throws IOException
IOExceptionpublic Object readObject(Class cl) throws IOException
readObject 在类中 AbstractHessianInputcl - the expected class if the protocol doesn't supply it.IOExceptionpublic Object readObject(Class cl, Class<?>... expectedTypes) throws IOException
AbstractHessianInputreadObject 在类中 AbstractHessianInputcl - the expected class if the protocol doesn't supply it.expectedTypes - the runtime type hints, eg: expectedClass equals Map, expectedTypes can
equals String.class, Short.classIOExceptionpublic Object readObject() throws IOException
readObject 在类中 AbstractHessianInputIOExceptionpublic Object readObject(List<Class<?>> expectedTypes) throws IOException
AbstractHessianInputreadObject 在类中 AbstractHessianInputexpectedTypes - the runtime type hints, eg: expectedTypes can
equals String.class, Short.class for HashMapIOExceptionpublic Object readRemote() throws IOException
readRemote 在类中 AbstractHessianInputIOExceptionpublic Object readRef() throws IOException
readRef 在类中 AbstractHessianInputIOExceptionpublic int readListStart()
throws IOException
readListStart 在类中 AbstractHessianInputIOExceptionpublic int readMapStart()
throws IOException
readMapStart 在类中 AbstractHessianInputIOExceptionpublic boolean isEnd()
throws IOException
isEnd 在类中 AbstractHessianInputIOExceptionpublic void readEnd()
throws IOException
readEnd 在类中 AbstractHessianInputIOExceptionpublic void readMapEnd()
throws IOException
readMapEnd 在类中 AbstractHessianInputIOExceptionpublic void readListEnd()
throws IOException
readListEnd 在类中 AbstractHessianInputIOExceptionpublic int addRef(Object ref)
addRef 在类中 AbstractHessianInputpublic void setRef(int i,
Object ref)
setRef 在类中 AbstractHessianInputpublic void resetReferences()
resetReferences 在类中 AbstractHessianInputpublic void reset()
public void resetBuffer()
public Object readStreamingObject() throws IOException
IOExceptionpublic Object resolveRemote(String type, String url) throws IOException
IOExceptionpublic String readType() throws IOException
type ::= string type ::= int
readType 在类中 AbstractHessianInputIOExceptionpublic int readLength()
throws IOException
l b32 b24 b16 b8
readLength 在类中 AbstractHessianInputIOExceptionpublic InputStream readInputStream() throws IOException
readInputStream 在类中 AbstractHessianInputIOExceptionpublic final int read()
throws IOException
IOExceptionpublic Reader getReader()
AbstractHessianInputs b16 b8 non-final string chunk S b16 b8 final string chunk
getReader 在类中 AbstractHessianInputpublic void free()
public void close()
throws IOException
close 在类中 AbstractHessianInputIOExceptionpublic boolean checkAndReadNull()
checkAndReadNull 在类中 AbstractHessianInputCopyright © 2011–2024 The Apache Software Foundation. All rights reserved.