|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.hessian.io.AbstractHessianInput
com.caucho.hessian.io.Hessian2Input
public class Hessian2Input
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
| Field Summary | |
|---|---|
protected java.util.ArrayList<com.caucho.hessian.io.Hessian2Input.ObjectDefinition> |
_classDefs
|
protected SerializerFactory |
_defaultSerializerFactory
|
protected java.util.ArrayList<java.lang.Object> |
_refs
|
protected SerializerFactory |
_serializerFactory
|
protected java.util.ArrayList<java.lang.String> |
_types
|
| Constructor Summary | |
|---|---|
Hessian2Input(java.io.InputStream is)
Creates a new Hessian input stream, initialized with an underlying input stream. |
|
| Method Summary | |
|---|---|
int |
addRef(java.lang.Object ref)
Adds a list/map reference. |
void |
close()
|
protected java.lang.String |
codeName(int ch)
|
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 |
protected java.io.IOException |
error(java.lang.String message)
|
protected java.io.IOException |
expect(java.lang.String expect,
int ch)
|
protected SerializerFactory |
findSerializerFactory()
Gets the serializer factory. |
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. |
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 |
protected void |
unread()
|
| Methods inherited from class com.caucho.hessian.io.AbstractHessianInput |
|---|
getRemoteResolver, init, readNode, readToOutputStream, setRemoteResolver, skipOptionalCall, startReplyBody |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected SerializerFactory _defaultSerializerFactory
protected SerializerFactory _serializerFactory
protected java.util.ArrayList<java.lang.Object> _refs
protected java.util.ArrayList<com.caucho.hessian.io.Hessian2Input.ObjectDefinition> _classDefs
protected java.util.ArrayList<java.lang.String> _types
| Constructor Detail |
|---|
public Hessian2Input(java.io.InputStream is)
is - the underlying input stream.| Method Detail |
|---|
public void setSerializerFactory(SerializerFactory factory)
setSerializerFactory in class AbstractHessianInputpublic SerializerFactory getSerializerFactory()
protected final SerializerFactory findSerializerFactory()
public void setCloseStreamOnClose(boolean isClose)
public boolean isCloseStreamOnClose()
public java.lang.String getMethod()
getMethod in class AbstractHessianInputpublic java.lang.Throwable getReplyFault()
public int readCall()
throws java.io.IOException
c major minor
readCall in class AbstractHessianInputjava.io.IOException
public int readEnvelope()
throws java.io.IOException
E major minor
java.io.IOException
public void completeEnvelope()
throws java.io.IOException
A successful completion will have a single value:
Z
java.io.IOException
public java.lang.String readMethod()
throws java.io.IOException
A successful completion will have a single value:
string
readMethod in class AbstractHessianInputjava.io.IOException
public int readMethodArgLength()
throws java.io.IOException
int
readMethodArgLength in class AbstractHessianInputjava.io.IOException
public void startCall()
throws java.io.IOException
The call expects the following protocol data
c major minor m b16 b8 method
startCall in class AbstractHessianInputjava.io.IOException
public java.lang.Object[] readArguments()
throws java.io.IOException
java.io.IOException
public void completeCall()
throws java.io.IOException
A successful completion will have a single value:
completeCall in class AbstractHessianInputjava.io.IOException
public java.lang.Object readReply(java.lang.Class expectedClass)
throws java.lang.Throwable
readReply in class AbstractHessianInputjava.lang.Throwable
public void startReply()
throws java.lang.Throwable
A successful completion will have a single value:
r
startReply in class AbstractHessianInputjava.lang.Throwable
public void completeReply()
throws java.io.IOException
A successful completion will have a single value:
z
completeReply in class AbstractHessianInputjava.io.IOException
public void completeValueReply()
throws java.io.IOException
A successful completion will have a single value:
z
java.io.IOException
public java.lang.String readHeader()
throws java.io.IOException
H b16 b8 value
readHeader in class AbstractHessianInputjava.io.IOException
public int startMessage()
throws java.io.IOException
p major minor
java.io.IOException
public void completeMessage()
throws java.io.IOException
A successful completion will have a single value:
z
java.io.IOException
public void readNull()
throws java.io.IOException
N
readNull in class AbstractHessianInputjava.io.IOException
public boolean readBoolean()
throws java.io.IOException
T F
readBoolean in class AbstractHessianInputjava.io.IOException
public short readShort()
throws java.io.IOException
I b32 b24 b16 b8
java.io.IOException
public final int readInt()
throws java.io.IOException
I b32 b24 b16 b8
readInt in class AbstractHessianInputjava.io.IOException
public long readLong()
throws java.io.IOException
L b64 b56 b48 b40 b32 b24 b16 b8
readLong in class AbstractHessianInputjava.io.IOException
public float readFloat()
throws java.io.IOException
D b64 b56 b48 b40 b32 b24 b16 b8
java.io.IOException
public double readDouble()
throws java.io.IOException
D b64 b56 b48 b40 b32 b24 b16 b8
readDouble in class AbstractHessianInputjava.io.IOException
public long readUTCDate()
throws java.io.IOException
T b64 b56 b48 b40 b32 b24 b16 b8
readUTCDate in class AbstractHessianInputjava.io.IOException
public int readChar()
throws java.io.IOException
java.io.IOException
public int readString(char[] buffer,
int offset,
int length)
throws java.io.IOException
java.io.IOException
public java.lang.String readString()
throws java.io.IOException
S b16 b8 string value
readString in class AbstractHessianInputjava.io.IOException
public byte[] readBytes()
throws java.io.IOException
B b16 b8 data value
readBytes in class AbstractHessianInputjava.io.IOException
public int readByte()
throws java.io.IOException
java.io.IOException
public int readBytes(byte[] buffer,
int offset,
int length)
throws java.io.IOException
java.io.IOException
public java.lang.Object readObject(java.lang.Class cl)
throws java.io.IOException
readObject in class AbstractHessianInputcl - the expected class if the protocol doesn't supply it.
java.io.IOException
public java.lang.Object readObject()
throws java.io.IOException
readObject in class AbstractHessianInputjava.io.IOException
public java.lang.Object readRemote()
throws java.io.IOException
readRemote in class AbstractHessianInputjava.io.IOException
public java.lang.Object readRef()
throws java.io.IOException
readRef in class AbstractHessianInputjava.io.IOException
public int readListStart()
throws java.io.IOException
readListStart in class AbstractHessianInputjava.io.IOException
public int readMapStart()
throws java.io.IOException
readMapStart in class AbstractHessianInputjava.io.IOException
public boolean isEnd()
throws java.io.IOException
isEnd in class AbstractHessianInputjava.io.IOException
public void readEnd()
throws java.io.IOException
readEnd in class AbstractHessianInputjava.io.IOException
public void readMapEnd()
throws java.io.IOException
readMapEnd in class AbstractHessianInputjava.io.IOException
public void readListEnd()
throws java.io.IOException
readListEnd in class AbstractHessianInputjava.io.IOExceptionpublic int addRef(java.lang.Object ref)
addRef in class AbstractHessianInput
public void setRef(int i,
java.lang.Object ref)
setRef in class AbstractHessianInputpublic void resetReferences()
resetReferences in class AbstractHessianInputpublic void reset()
public void resetBuffer()
public java.lang.Object readStreamingObject()
throws java.io.IOException
java.io.IOException
public java.lang.Object resolveRemote(java.lang.String type,
java.lang.String url)
throws java.io.IOException
java.io.IOException
public java.lang.String readType()
throws java.io.IOException
type ::= string type ::= int
readType in class AbstractHessianInputjava.io.IOException
public int readLength()
throws java.io.IOException
l b32 b24 b16 b8
readLength in class AbstractHessianInputjava.io.IOException
public java.io.InputStream readInputStream()
throws java.io.IOException
readInputStream in class AbstractHessianInputjava.io.IOException
public final int read()
throws java.io.IOException
java.io.IOExceptionprotected void unread()
public java.io.Reader getReader()
AbstractHessianInputs b16 b8 non-final string chunk S b16 b8 final string chunk
getReader in class AbstractHessianInput
protected java.io.IOException expect(java.lang.String expect,
int ch)
throws java.io.IOException
java.io.IOExceptionprotected java.lang.String codeName(int ch)
protected java.io.IOException error(java.lang.String message)
public void close()
throws java.io.IOException
close in class AbstractHessianInputjava.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||