类 HessianInput
- java.lang.Object
-
- com.alibaba.com.caucho.hessian.io.AbstractHessianInput
-
- com.alibaba.com.caucho.hessian.io.HessianInput
-
- 直接已知子类:
HessianSerializerInput
public class HessianInput extends AbstractHessianInput
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
-
-
构造器概要
构造器 构造器 说明 HessianInput()Creates an uninitialized Hessian input stream.HessianInput(InputStream is)Creates a new Hessian input stream, initialized with an underlying input stream.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 intaddRef(Object ref)Adds a list/map reference.booleancheckAndReadNull()voidclose()voidcompleteCall()Completes reading the callvoidcompleteReply()Completes reading the callvoidcompleteValueReply()Completes reading the callStringgetMethod()Returns the calls methodReadergetReader()Starts reading a string.ThrowablegetReplyFault()Returns any reply fault.SerializerFactorygetSerializerFactory()Gets the serializer factory.voidinit(InputStream is)Initialize the hessian stream with the underlying input stream.booleanisEnd()Returns true if this is the end of a list or a map.booleanreadBoolean()Reads a booleanintreadByte()Reads a byte from the stream.byte[]readBytes()Reads a byte arrayintreadBytes(byte[] buffer, int offset, int length)Reads a byte array from the stream.intreadCall()Starts reading the callintreadChar()Reads a byte from the stream.doublereadDouble()Reads a doublevoidreadEnd()Reads the end byte.floatreadFloat()Reads a floatStringreadHeader()Reads a header, returning null if there are no headers.InputStreamreadInputStream()Reads bytes based on an input stream.intreadInt()Reads an integerintreadLength()Parses the length for an arrayvoidreadListEnd()Reads the end byte.intreadListStart()Reads the start of a list.longreadLong()Reads a longvoidreadMapEnd()Reads the end byte.intreadMapStart()Reads the start of a list.StringreadMethod()Starts reading the callNodereadNode()Reads an XML node.voidreadNull()Reads a nullObjectreadObject()Reads an arbitrary object from the input stream when the type is unknown.ObjectreadObject(Class cl)Reads an object from the input stream with an expected type.ObjectreadObject(Class expectedClass, Class<?>... expectedTypes)Reads an object from the input stream with an expected type.ObjectreadObject(List<Class<?>> expectedTypes)Reads an arbitrary object from the input stream when the type is unknown.ObjectreadRef()Reads a reference.ObjectreadRemote()Reads a remote object.ObjectreadReply(Class expectedClass)Reads a reply as an object.shortreadShort()Reads a shortStringreadString()Reads a stringintreadString(char[] buffer, int offset, int length)Reads a byte array from the stream.StringreadType()Parses a type from the stream.longreadUTCDate()Reads a date.voidresetReferences()Resets the references for streaming.ObjectresolveRemote(String type, String url)Resolves a remote object.voidsetRef(int i, Object ref)Adds a list/map reference.voidsetSerializerFactory(SerializerFactory factory)Sets the serializer factory.voidskipOptionalCall()For backward compatibility with HessianSkeletonvoidstartCall()Starts reading the call, including the headers.voidstartReply()Starts reading the reply-
从类继承的方法 com.alibaba.com.caucho.hessian.io.AbstractHessianInput
getRemoteResolver, readMethodArgLength, setRemoteResolver
-
-
-
-
构造器详细资料
-
HessianInput
public HessianInput()
Creates an uninitialized Hessian input stream.
-
HessianInput
public HessianInput(InputStream is)
Creates a new Hessian input stream, initialized with an underlying input stream.- 参数:
is- the underlying input stream.
-
-
方法详细资料
-
getSerializerFactory
public SerializerFactory getSerializerFactory()
Gets the serializer factory.
-
setSerializerFactory
public void setSerializerFactory(SerializerFactory factory)
Sets the serializer factory.
-
init
public void init(InputStream is)
Initialize the hessian stream with the underlying input stream.- 覆盖:
init在类中AbstractHessianInput
-
getMethod
public String getMethod()
Returns the calls method- 指定者:
getMethod在类中AbstractHessianInput
-
getReplyFault
public Throwable getReplyFault()
Returns any reply fault.
-
checkAndReadNull
public boolean checkAndReadNull()
- 指定者:
checkAndReadNull在类中AbstractHessianInput
-
readCall
public int readCall() throws IOExceptionStarts reading the callc major minor
- 指定者:
readCall在类中AbstractHessianInput- 抛出:
IOException
-
skipOptionalCall
public void skipOptionalCall() throws IOExceptionFor backward compatibility with HessianSkeleton- 覆盖:
skipOptionalCall在类中AbstractHessianInput- 抛出:
IOException
-
readMethod
public String readMethod() throws IOException
Starts reading the callA successful completion will have a single value:
m b16 b8 method
- 指定者:
readMethod在类中AbstractHessianInput- 抛出:
IOException
-
startCall
public void startCall() throws IOExceptionStarts reading the call, including the headers.The call expects the following protocol data
c major minor m b16 b8 method
- 指定者:
startCall在类中AbstractHessianInput- 抛出:
IOException
-
completeCall
public void completeCall() throws IOExceptionCompletes reading the callA successful completion will have a single value:
z
- 指定者:
completeCall在类中AbstractHessianInput- 抛出:
IOException
-
readReply
public Object readReply(Class expectedClass) throws Throwable
Reads a reply as an object. If the reply has a fault, throws the exception.- 指定者:
readReply在类中AbstractHessianInput- 抛出:
Throwable
-
startReply
public void startReply() throws ThrowableStarts reading the replyA successful completion will have a single value:
r
- 指定者:
startReply在类中AbstractHessianInput- 抛出:
Throwable
-
completeReply
public void completeReply() throws IOExceptionCompletes reading the callA successful completion will have a single value:
z
- 指定者:
completeReply在类中AbstractHessianInput- 抛出:
IOException
-
completeValueReply
public void completeValueReply() throws IOExceptionCompletes reading the callA successful completion will have a single value:
z
- 抛出:
IOException
-
readHeader
public String readHeader() throws IOException
Reads a header, returning null if there are no headers.H b16 b8 value
- 指定者:
readHeader在类中AbstractHessianInput- 抛出:
IOException
-
readNull
public void readNull() throws IOExceptionReads a nullN
- 指定者:
readNull在类中AbstractHessianInput- 抛出:
IOException
-
readBoolean
public boolean readBoolean() throws IOExceptionReads a booleanT F
- 指定者:
readBoolean在类中AbstractHessianInput- 抛出:
IOException
-
readShort
public short readShort() throws IOExceptionReads a shortI b32 b24 b16 b8
- 抛出:
IOException
-
readInt
public int readInt() throws IOExceptionReads an integerI b32 b24 b16 b8
- 指定者:
readInt在类中AbstractHessianInput- 抛出:
IOException
-
readLong
public long readLong() throws IOExceptionReads a longL b64 b56 b48 b40 b32 b24 b16 b8
- 指定者:
readLong在类中AbstractHessianInput- 抛出:
IOException
-
readFloat
public float readFloat() throws IOExceptionReads a floatD b64 b56 b48 b40 b32 b24 b16 b8
- 抛出:
IOException
-
readDouble
public double readDouble() throws IOExceptionReads a doubleD b64 b56 b48 b40 b32 b24 b16 b8
- 指定者:
readDouble在类中AbstractHessianInput- 抛出:
IOException
-
readUTCDate
public long readUTCDate() throws IOExceptionReads a date.T b64 b56 b48 b40 b32 b24 b16 b8
- 指定者:
readUTCDate在类中AbstractHessianInput- 抛出:
IOException
-
readChar
public int readChar() throws IOExceptionReads a byte from the stream.- 抛出:
IOException
-
readString
public int readString(char[] buffer, int offset, int length) throws IOExceptionReads a byte array from the stream.- 抛出:
IOException
-
readString
public String readString() throws IOException
Reads a stringS b16 b8 string value
- 指定者:
readString在类中AbstractHessianInput- 抛出:
IOException
-
readNode
public Node readNode() throws IOException
Reads an XML node.S b16 b8 string value
- 覆盖:
readNode在类中AbstractHessianInput- 抛出:
IOException
-
readBytes
public byte[] readBytes() throws IOExceptionReads a byte arrayB b16 b8 data value
- 指定者:
readBytes在类中AbstractHessianInput- 抛出:
IOException
-
readByte
public int readByte() throws IOExceptionReads a byte from the stream.- 抛出:
IOException
-
readBytes
public int readBytes(byte[] buffer, int offset, int length) throws IOExceptionReads a byte array from the stream.- 抛出:
IOException
-
readObject
public Object readObject(Class cl) throws IOException
Reads an object from the input stream with an expected type.- 指定者:
readObject在类中AbstractHessianInput- 参数:
cl- the expected class if the protocol doesn't supply it.- 抛出:
IOException
-
readObject
public Object readObject(Class expectedClass, Class<?>... expectedTypes) throws IOException
Reads an object from the input stream with an expected type.- 覆盖:
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- 抛出:
IOException
-
readObject
public Object readObject() throws IOException
Reads an arbitrary object from the input stream when the type is unknown.- 指定者:
readObject在类中AbstractHessianInput- 抛出:
IOException
-
readObject
public Object readObject(List<Class<?>> expectedTypes) throws IOException
Reads an arbitrary object from the input stream when the type is unknown.- 覆盖:
readObject在类中AbstractHessianInput- 参数:
expectedTypes- the runtime type hints, eg: expectedTypes can equals String.class, Short.class for HashMap- 抛出:
IOException
-
readRemote
public Object readRemote() throws IOException
Reads a remote object.- 指定者:
readRemote在类中AbstractHessianInput- 抛出:
IOException
-
readRef
public Object readRef() throws IOException
Reads a reference.- 指定者:
readRef在类中AbstractHessianInput- 抛出:
IOException
-
readListStart
public int readListStart() throws IOExceptionReads the start of a list.- 指定者:
readListStart在类中AbstractHessianInput- 抛出:
IOException
-
readMapStart
public int readMapStart() throws IOExceptionReads the start of a list.- 指定者:
readMapStart在类中AbstractHessianInput- 抛出:
IOException
-
isEnd
public boolean isEnd() throws IOExceptionReturns true if this is the end of a list or a map.- 指定者:
isEnd在类中AbstractHessianInput- 抛出:
IOException
-
readEnd
public void readEnd() throws IOExceptionReads the end byte.- 指定者:
readEnd在类中AbstractHessianInput- 抛出:
IOException
-
readMapEnd
public void readMapEnd() throws IOExceptionReads the end byte.- 指定者:
readMapEnd在类中AbstractHessianInput- 抛出:
IOException
-
readListEnd
public void readListEnd() throws IOExceptionReads the end byte.- 指定者:
readListEnd在类中AbstractHessianInput- 抛出:
IOException
-
addRef
public int addRef(Object ref)
Adds a list/map reference.- 指定者:
addRef在类中AbstractHessianInput
-
setRef
public void setRef(int i, Object ref)Adds a list/map reference.- 指定者:
setRef在类中AbstractHessianInput
-
resetReferences
public void resetReferences()
Resets the references for streaming.- 覆盖:
resetReferences在类中AbstractHessianInput
-
resolveRemote
public Object resolveRemote(String type, String url) throws IOException
Resolves a remote object.- 抛出:
IOException
-
readType
public String readType() throws IOException
Parses a type from the stream.t b16 b8
- 指定者:
readType在类中AbstractHessianInput- 抛出:
IOException
-
readLength
public int readLength() throws IOExceptionParses the length for an arrayl b32 b24 b16 b8
- 指定者:
readLength在类中AbstractHessianInput- 抛出:
IOException
-
readInputStream
public InputStream readInputStream() throws IOException
Reads bytes based on an input stream.- 指定者:
readInputStream在类中AbstractHessianInput- 抛出:
IOException
-
close
public void close()
- 覆盖:
close在类中AbstractHessianInput
-
getReader
public Reader getReader()
从类复制的说明:AbstractHessianInputStarts 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
-
-