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