类 Hessian2Input
-
- com.alibaba.com.caucho.hessian.io.AbstractHessianInput
-
- com.alibaba.com.caucho.hessian.io.Hessian2Input
-
- 所有已实现的接口:
Hessian2Constants
public class Hessian2Input extends AbstractHessianInput implements Hessian2Constants
Input stream for Hessian requests.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
-
-
字段概要
-
从接口继承的字段 com.alibaba.com.caucho.hessian.io.Hessian2Constants
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
-
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 int
ref)
Adds a list/map reference.boolean
checkAndReadNull()
void
close()
void
completeCall()
Completes reading the callvoid
completeEnvelope()
Completes reading the envelopevoid
completeMessage()
Completes reading the messagevoid
completeReply()
Completes reading the callvoid
completeValueReply()
Completes reading the callSerializerFactory
findSerializerFactory()
Gets the serializer factory, creating a default if necessary.getMethod()
Returns the calls methodgetReader()
Starts reading a string.getReplyFault()
Returns any reply fault.SerializerFactory
getSerializerFactory()
Gets the serializer factory.void
is)
Initialize the Hessian stream with the underlying input stream.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.boolean
readBoolean()
Reads a booleanint
readByte()
Reads a byte from the stream.byte[]
readBytes()
Reads a byte arrayint
readBytes(byte[] buffer, int offset, int length)
Reads a byte array from the stream.int
readCall()
Starts reading the callint
readChar()
Reads a byte from the stream.double
readDouble()
Reads a doublevoid
readEnd()
Reads the end byte.int
readEnvelope()
Starts reading the envelopefloat
readFloat()
Reads a floatreadHeader()
Reads a header, returning null if there are no headers.readInputStream()
Reads bytes based on an input stream.int
readInt()
Reads an integerint
readLength()
Parses the length for an arrayvoid
readListEnd()
Reads the end byte.int
readListStart()
Reads the start of a list.long
readLong()
Reads a longvoid
readMapEnd()
Reads the end byte.int
readMapStart()
Reads the start of a list.readMethod()
Starts reading the callint
readMethodArgLength()
Returns the number of method argumentsvoid
readNull()
Reads a nullreadObject()
Reads an arbitrary object from the input stream when the type is unknown.cl)
Reads an object from the input stream with an expected type.expectedClass, <?>... expectedTypes)
Reads an arbitrary object from the input stream.<<?>> expectedTypes)
Reads an arbitrary object from the input stream.readRef()
Reads a reference.readRemote()
Reads a remote object.expectedClass)
Reads a reply as an object.short
readShort()
Reads a shortreadStreamingObject()
readString()
Reads a stringint
readString(char[] buffer, int offset, int length)
Reads a byte array from the stream.readType()
Parses a type from the stream.long
readUTCDate()
Reads a date.void
reset()
void
resetReferences()
Resets the references for streaming.type, url)
Resolves a remote object.void
setCloseStreamOnClose(boolean isClose)
void
setRef(int i, 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 the messagevoid
startReply()
Starts reading the reply-
从类继承的方法 com.alibaba.com.caucho.hessian.io.AbstractHessianInput
getRemoteResolver, readNode, setRemoteResolver, skipOptionalCall
-
-
-
-
方法详细资料
-
getSerializerFactory
public SerializerFactory getSerializerFactory()
Gets the serializer factory.
-
setSerializerFactory
public void setSerializerFactory(SerializerFactory factory)
Sets the serializer factory.
-
findSerializerFactory
public final SerializerFactory findSerializerFactory()
Gets the serializer factory, creating a default if necessary.
-
isCloseStreamOnClose
public boolean isCloseStreamOnClose()
-
setCloseStreamOnClose
public void setCloseStreamOnClose(boolean isClose)
-
getMethod
public getMethod()
Returns the calls method- 指定者:
getMethod
在类中AbstractHessianInput
-
getReplyFault
public getReplyFault()
Returns any reply fault.
-
init
public void init( is)
从类复制的说明:AbstractHessianInput
Initialize the Hessian stream with the underlying input stream.- 覆盖:
init
在类中AbstractHessianInput
-
reset
public void reset()
-
checkAndReadNull
public boolean checkAndReadNull()
- 指定者:
checkAndReadNull
在类中AbstractHessianInput
-
readCall
public int readCall() throws
Starts reading the callc major minor
- 指定者:
readCall
在类中AbstractHessianInput
- 抛出:
-
readEnvelope
public int readEnvelope() throws
Starts reading the envelopeE major minor
- 抛出:
-
completeEnvelope
public void completeEnvelope() throws
Completes reading the envelopeA successful completion will have a single value:
Z
- 抛出:
-
readMethod
public readMethod() throws
Starts reading the callA successful completion will have a single value:
string
- 指定者:
readMethod
在类中AbstractHessianInput
- 抛出:
-
readMethodArgLength
public int readMethodArgLength() throws
Returns the number of method argumentsint
- 覆盖:
readMethodArgLength
在类中AbstractHessianInput
- 返回:
- -1 for a variable length (hessian 1.0)
- 抛出:
-
startCall
public void startCall() throws
Starts reading the call, including the headers.The call expects the following protocol data
c major minor m b16 b8 method
- 指定者:
startCall
在类中AbstractHessianInput
- 抛出:
-
completeCall
public void completeCall() throws
Completes reading the callA successful completion will have a single value:
- 指定者:
completeCall
在类中AbstractHessianInput
- 抛出:
-
readReply
public readReply( expectedClass) throws
Reads a reply as an object. If the reply has a fault, throws the exception.- 指定者:
readReply
在类中AbstractHessianInput
- 抛出:
-
startReply
public void startReply() throws
Starts reading the replyA successful completion will have a single value:
r
- 指定者:
startReply
在类中AbstractHessianInput
- 抛出:
-
completeReply
public void completeReply() throws
Completes reading the callA successful completion will have a single value:
z
- 指定者:
completeReply
在类中AbstractHessianInput
- 抛出:
-
completeValueReply
public void completeValueReply() throws
Completes reading the callA successful completion will have a single value:
z
- 抛出:
-
readHeader
public readHeader() throws
Reads a header, returning null if there are no headers.H b16 b8 value
- 指定者:
readHeader
在类中AbstractHessianInput
- 抛出:
-
startMessage
public int startMessage() throws
Starts reading the messagep major minor
- 抛出:
-
completeMessage
public void completeMessage() throws
Completes reading the messageA successful completion will have a single value:
z
- 抛出:
-
readNull
public void readNull() throws
Reads a nullN
- 指定者:
readNull
在类中AbstractHessianInput
- 抛出:
-
readBoolean
public boolean readBoolean() throws
Reads a booleanT F
- 指定者:
readBoolean
在类中AbstractHessianInput
- 抛出:
-
readShort
public short readShort() throws
Reads a shortI b32 b24 b16 b8
- 抛出:
-
readInt
public final int readInt() throws
Reads an integerI b32 b24 b16 b8
- 指定者:
readInt
在类中AbstractHessianInput
- 抛出:
-
readLong
public long readLong() throws
Reads a longL b64 b56 b48 b40 b32 b24 b16 b8
- 指定者:
readLong
在类中AbstractHessianInput
- 抛出:
-
readFloat
public float readFloat() throws
Reads a floatD b64 b56 b48 b40 b32 b24 b16 b8
- 抛出:
-
readDouble
public double readDouble() throws
Reads a doubleD b64 b56 b48 b40 b32 b24 b16 b8
- 指定者:
readDouble
在类中AbstractHessianInput
- 抛出:
-
readUTCDate
public long readUTCDate() throws
Reads a date.T b64 b56 b48 b40 b32 b24 b16 b8
- 指定者:
readUTCDate
在类中AbstractHessianInput
- 抛出:
-
readChar
public int readChar() throws
Reads a byte from the stream.- 抛出:
-
readString
public int readString(char[] buffer, int offset, int length) throws
Reads a byte array from the stream.- 抛出:
-
readString
public readString() throws
Reads a stringS b16 b8 string value
- 指定者:
readString
在类中AbstractHessianInput
- 抛出:
-
readBytes
public byte[] readBytes() throws
Reads a byte arrayB b16 b8 data value
- 指定者:
readBytes
在类中AbstractHessianInput
- 抛出:
-
readByte
public int readByte() throws
Reads a byte from the stream.- 抛出:
-
readBytes
public int readBytes(byte[] buffer, int offset, int length) throws
Reads a byte array from the stream.- 抛出:
-
readObject
public readObject( cl) throws
Reads an object from the input stream with an expected type.- 指定者:
readObject
在类中AbstractHessianInput
- 参数:
cl
- the expected class if the protocol doesn't supply it.- 抛出:
-
readObject
public readObject( expectedClass, <?>... expectedTypes) throws
从类复制的说明:AbstractHessianInput
Reads an arbitrary object from the input stream.- 覆盖:
readObject
在类中AbstractHessianInput
- 参数:
expectedClass
- 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.class- 抛出:
-
readObject
public readObject() throws
Reads an arbitrary object from the input stream when the type is unknown.- 指定者:
readObject
在类中AbstractHessianInput
- 抛出:
-
readObject
public readObject(<<?>> expectedTypes) throws
从类复制的说明:AbstractHessianInput
Reads an arbitrary object from the input stream.- 覆盖:
readObject
在类中AbstractHessianInput
- 参数:
expectedTypes
- the runtime type hints, eg: expectedTypes can equals String.class, Short.class for HashMap- 抛出:
-
readRemote
public readRemote() throws
Reads a remote object.- 指定者:
readRemote
在类中AbstractHessianInput
- 抛出:
-
readRef
public readRef() throws
Reads a reference.- 指定者:
readRef
在类中AbstractHessianInput
- 抛出:
-
readListStart
public int readListStart() throws
Reads the start of a list.- 指定者:
readListStart
在类中AbstractHessianInput
- 抛出:
-
readMapStart
public int readMapStart() throws
Reads the start of a list.- 指定者:
readMapStart
在类中AbstractHessianInput
- 抛出:
-
isEnd
public boolean isEnd() throws
Returns true if this is the end of a list or a map.- 指定者:
isEnd
在类中AbstractHessianInput
- 抛出:
-
readEnd
public void readEnd() throws
Reads the end byte.- 指定者:
readEnd
在类中AbstractHessianInput
- 抛出:
-
readMapEnd
public void readMapEnd() throws
Reads the end byte.- 指定者:
readMapEnd
在类中AbstractHessianInput
- 抛出:
-
readListEnd
public void readListEnd() throws
Reads the end byte.- 指定者:
readListEnd
在类中AbstractHessianInput
- 抛出:
-
addRef
public int addRef( ref)
Adds a list/map reference.- 指定者:
addRef
在类中AbstractHessianInput
-
setRef
public void setRef(int i, ref)
Adds a list/map reference.- 指定者:
setRef
在类中AbstractHessianInput
-
resetReferences
public void resetReferences()
Resets the references for streaming.- 覆盖:
resetReferences
在类中AbstractHessianInput
-
readStreamingObject
public readStreamingObject() throws
- 抛出:
-
resolveRemote
public resolveRemote( type, url) throws
Resolves a remote object.- 抛出:
-
readType
public readType() throws
Parses a type from the stream.type ::= string type ::= int
- 指定者:
readType
在类中AbstractHessianInput
- 抛出:
-
readLength
public int readLength() throws
Parses the length for an arrayl b32 b24 b16 b8
- 指定者:
readLength
在类中AbstractHessianInput
- 抛出:
-
readInputStream
public readInputStream() throws
Reads bytes based on an input stream.- 指定者:
readInputStream
在类中AbstractHessianInput
- 抛出:
-
read
public final int read() throws
Normally, shouldn't be called externally, but needed for QA, e.g. ejb/3b01.- 抛出:
-
getReader
public getReader()
从类复制的说明:AbstractHessianInput
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
- 指定者:
getReader
在类中AbstractHessianInput
-
close
public void close() throws
- 覆盖:
close
在类中AbstractHessianInput
- 抛出:
-
-