com.caucho.hessian.io
类 Hessian2Input

java.lang.Object
  继承者 com.caucho.hessian.io.AbstractHessianInput
      继承者 com.caucho.hessian.io.Hessian2Input
所有已实现的接口:
Hessian2Constants
直接已知子类:
HessianSerializerInput

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.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
 
构造方法摘要
Hessian2Input()
           
Hessian2Input(java.io.InputStream is)
          Creates a new Hessian input stream, initialized with an underlying input stream.
 
方法摘要
 int addRef(java.lang.Object ref)
          Adds a list/map reference.
 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()
           
 java.lang.String getMethod()
          Returns the calls method
 java.io.Reader getReader()
          Starts reading a string.
 java.lang.Throwable getReplyFault()
          Returns any reply fault.
 SerializerFactory getSerializerFactory()
          Gets the serializer factory.
 void init(java.io.InputStream is)
          Initialize the Hessian stream with the underlying input stream.
 void initPacket(java.io.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.
 java.lang.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
 java.lang.String readHeader()
          Reads a header, returning null if there are no headers.
 java.io.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.
 java.lang.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
 java.lang.Object readObject()
          Reads an arbitrary object from the input stream when the type is unknown.
 java.lang.Object readObject(java.lang.Class cl)
          Reads an object from the input stream with an expected type.
 java.lang.Object readRef()
          Reads a reference.
 java.lang.Object readRemote()
          Reads a remote object.
 java.lang.Object readReply(java.lang.Class expectedClass)
          Reads a reply as an object.
 short readShort()
          Reads a short I b32 b24 b16 b8
 java.lang.Object readStreamingObject()
           
 java.lang.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.
 java.lang.String readType()
          Parses a type from the stream.
 long readUTCDate()
          Reads a date.
 void reset()
           
 void resetBuffer()
           
 void resetReferences()
          Resets the references for streaming.
 java.lang.Object resolveRemote(java.lang.String type, java.lang.String url)
          Resolves a remote object.
 void setCloseStreamOnClose(boolean isClose)
           
 void setRef(int i, java.lang.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
 
从类 com.caucho.hessian.io.AbstractHessianInput 继承的方法
getRemoteResolver, readNode, readToOutputStream, setRemoteResolver, skipOptionalCall, startReplyBody
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

Hessian2Input

public Hessian2Input()

Hessian2Input

public Hessian2Input(java.io.InputStream is)
Creates a new Hessian input stream, initialized with an underlying input stream.

参数:
is - the underlying input stream.
方法详细信息

setSerializerFactory

public void setSerializerFactory(SerializerFactory factory)
Sets the serializer factory.

覆盖:
AbstractHessianInput 中的 setSerializerFactory

getSerializerFactory

public SerializerFactory getSerializerFactory()
Gets the serializer factory.


setCloseStreamOnClose

public void setCloseStreamOnClose(boolean isClose)

isCloseStreamOnClose

public boolean isCloseStreamOnClose()

getMethod

public java.lang.String getMethod()
Returns the calls method

指定者:
AbstractHessianInput 中的 getMethod

getReplyFault

public java.lang.Throwable getReplyFault()
Returns any reply fault.


init

public void init(java.io.InputStream is)
从类 AbstractHessianInput 复制的描述
Initialize the Hessian stream with the underlying input stream.

覆盖:
AbstractHessianInput 中的 init

initPacket

public void initPacket(java.io.InputStream is)

readCall

public int readCall()
             throws java.io.IOException
Starts reading the call
 c major minor
 

指定者:
AbstractHessianInput 中的 readCall
抛出:
java.io.IOException

readEnvelope

public int readEnvelope()
                 throws java.io.IOException
Starts reading the envelope
 E major minor
 

抛出:
java.io.IOException

completeEnvelope

public void completeEnvelope()
                      throws java.io.IOException
Completes reading the envelope

A successful completion will have a single value:

 Z
 

抛出:
java.io.IOException

readMethod

public java.lang.String readMethod()
                            throws java.io.IOException
Starts reading the call

A successful completion will have a single value:

 string
 

指定者:
AbstractHessianInput 中的 readMethod
抛出:
java.io.IOException

readMethodArgLength

public int readMethodArgLength()
                        throws java.io.IOException
Returns the number of method arguments
 int
 

覆盖:
AbstractHessianInput 中的 readMethodArgLength
返回:
-1 for a variable length (hessian 1.0)
抛出:
java.io.IOException

startCall

public void startCall()
               throws java.io.IOException
Starts reading the call, including the headers.

The call expects the following protocol data

 c major minor
 m b16 b8 method
 

指定者:
AbstractHessianInput 中的 startCall
抛出:
java.io.IOException

readArguments

public java.lang.Object[] readArguments()
                                 throws java.io.IOException
抛出:
java.io.IOException

completeCall

public void completeCall()
                  throws java.io.IOException
Completes reading the call

A successful completion will have a single value:

 

指定者:
AbstractHessianInput 中的 completeCall
抛出:
java.io.IOException

readReply

public java.lang.Object readReply(java.lang.Class expectedClass)
                           throws java.lang.Throwable
Reads a reply as an object. If the reply has a fault, throws the exception.

指定者:
AbstractHessianInput 中的 readReply
抛出:
java.lang.Throwable

startReply

public void startReply()
                throws java.lang.Throwable
Starts reading the reply

A successful completion will have a single value:

 r
 

指定者:
AbstractHessianInput 中的 startReply
抛出:
java.lang.Throwable

completeReply

public void completeReply()
                   throws java.io.IOException
Completes reading the call

A successful completion will have a single value:

 z
 

指定者:
AbstractHessianInput 中的 completeReply
抛出:
java.io.IOException

completeValueReply

public void completeValueReply()
                        throws java.io.IOException
Completes reading the call

A successful completion will have a single value:

 z
 

抛出:
java.io.IOException

readHeader

public java.lang.String readHeader()
                            throws java.io.IOException
Reads a header, returning null if there are no headers.
 H b16 b8 value
 

指定者:
AbstractHessianInput 中的 readHeader
抛出:
java.io.IOException

startMessage

public int startMessage()
                 throws java.io.IOException
Starts reading a packet
 p major minor
 

抛出:
java.io.IOException

completeMessage

public void completeMessage()
                     throws java.io.IOException
Completes reading the message

A successful completion will have a single value:

 z
 

抛出:
java.io.IOException

readNull

public void readNull()
              throws java.io.IOException
Reads a null
 N
 

指定者:
AbstractHessianInput 中的 readNull
抛出:
java.io.IOException

readBoolean

public boolean readBoolean()
                    throws java.io.IOException
Reads a boolean
 T
 F
 

指定者:
AbstractHessianInput 中的 readBoolean
抛出:
java.io.IOException

readShort

public short readShort()
                throws java.io.IOException
Reads a short
 I b32 b24 b16 b8
 

抛出:
java.io.IOException

readInt

public final int readInt()
                  throws java.io.IOException
Reads an integer
 I b32 b24 b16 b8
 

指定者:
AbstractHessianInput 中的 readInt
抛出:
java.io.IOException

readLong

public long readLong()
              throws java.io.IOException
Reads a long
 L b64 b56 b48 b40 b32 b24 b16 b8
 

指定者:
AbstractHessianInput 中的 readLong
抛出:
java.io.IOException

readFloat

public float readFloat()
                throws java.io.IOException
Reads a float
 D b64 b56 b48 b40 b32 b24 b16 b8
 

抛出:
java.io.IOException

readDouble

public double readDouble()
                  throws java.io.IOException
Reads a double
 D b64 b56 b48 b40 b32 b24 b16 b8
 

指定者:
AbstractHessianInput 中的 readDouble
抛出:
java.io.IOException

readUTCDate

public long readUTCDate()
                 throws java.io.IOException
Reads a date.
 T b64 b56 b48 b40 b32 b24 b16 b8
 

指定者:
AbstractHessianInput 中的 readUTCDate
抛出:
java.io.IOException

readChar

public int readChar()
             throws java.io.IOException
Reads a byte from the stream.

抛出:
java.io.IOException

readString

public int readString(char[] buffer,
                      int offset,
                      int length)
               throws java.io.IOException
Reads a byte array from the stream.

抛出:
java.io.IOException

readString

public java.lang.String readString()
                            throws java.io.IOException
Reads a string
 S b16 b8 string value
 

指定者:
AbstractHessianInput 中的 readString
抛出:
java.io.IOException

readBytes

public byte[] readBytes()
                 throws java.io.IOException
Reads a byte array
 B b16 b8 data value
 

指定者:
AbstractHessianInput 中的 readBytes
抛出:
java.io.IOException

readByte

public int readByte()
             throws java.io.IOException
Reads a byte from the stream.

抛出:
java.io.IOException

readBytes

public int readBytes(byte[] buffer,
                     int offset,
                     int length)
              throws java.io.IOException
Reads a byte array from the stream.

抛出:
java.io.IOException

readObject

public java.lang.Object readObject(java.lang.Class cl)
                            throws java.io.IOException
Reads an object from the input stream with an expected type.

指定者:
AbstractHessianInput 中的 readObject
参数:
cl - the expected class if the protocol doesn't supply it.
抛出:
java.io.IOException

readObject

public java.lang.Object readObject()
                            throws java.io.IOException
Reads an arbitrary object from the input stream when the type is unknown.

指定者:
AbstractHessianInput 中的 readObject
抛出:
java.io.IOException

readRemote

public java.lang.Object readRemote()
                            throws java.io.IOException
Reads a remote object.

指定者:
AbstractHessianInput 中的 readRemote
抛出:
java.io.IOException

readRef

public java.lang.Object readRef()
                         throws java.io.IOException
Reads a reference.

指定者:
AbstractHessianInput 中的 readRef
抛出:
java.io.IOException

readListStart

public int readListStart()
                  throws java.io.IOException
Reads the start of a list.

指定者:
AbstractHessianInput 中的 readListStart
抛出:
java.io.IOException

readMapStart

public int readMapStart()
                 throws java.io.IOException
Reads the start of a list.

指定者:
AbstractHessianInput 中的 readMapStart
抛出:
java.io.IOException

isEnd

public boolean isEnd()
              throws java.io.IOException
Returns true if this is the end of a list or a map.

指定者:
AbstractHessianInput 中的 isEnd
抛出:
java.io.IOException

readEnd

public void readEnd()
             throws java.io.IOException
Reads the end byte.

指定者:
AbstractHessianInput 中的 readEnd
抛出:
java.io.IOException

readMapEnd

public void readMapEnd()
                throws java.io.IOException
Reads the end byte.

指定者:
AbstractHessianInput 中的 readMapEnd
抛出:
java.io.IOException

readListEnd

public void readListEnd()
                 throws java.io.IOException
Reads the end byte.

指定者:
AbstractHessianInput 中的 readListEnd
抛出:
java.io.IOException

addRef

public int addRef(java.lang.Object ref)
Adds a list/map reference.

指定者:
AbstractHessianInput 中的 addRef

setRef

public void setRef(int i,
                   java.lang.Object ref)
Adds a list/map reference.

指定者:
AbstractHessianInput 中的 setRef

resetReferences

public void resetReferences()
Resets the references for streaming.

覆盖:
AbstractHessianInput 中的 resetReferences

reset

public void reset()

resetBuffer

public void resetBuffer()

readStreamingObject

public java.lang.Object readStreamingObject()
                                     throws java.io.IOException
抛出:
java.io.IOException

resolveRemote

public java.lang.Object resolveRemote(java.lang.String type,
                                      java.lang.String url)
                               throws java.io.IOException
Resolves a remote object.

抛出:
java.io.IOException

readType

public java.lang.String readType()
                          throws java.io.IOException
Parses a type from the stream.
 type ::= string
 type ::= int
 

指定者:
AbstractHessianInput 中的 readType
抛出:
java.io.IOException

readLength

public int readLength()
               throws java.io.IOException
Parses the length for an array
 l b32 b24 b16 b8
 

指定者:
AbstractHessianInput 中的 readLength
抛出:
java.io.IOException

readInputStream

public java.io.InputStream readInputStream()
                                    throws java.io.IOException
Reads bytes based on an input stream.

指定者:
AbstractHessianInput 中的 readInputStream
抛出:
java.io.IOException

read

public final int read()
               throws java.io.IOException
Normally, shouldn't be called externally, but needed for QA, e.g. ejb/3b01.

抛出:
java.io.IOException

getReader

public java.io.Reader 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
 

指定者:
AbstractHessianInput 中的 getReader

free

public void free()

close

public void close()
           throws java.io.IOException
覆盖:
AbstractHessianInput 中的 close
抛出:
java.io.IOException