Package com.caucho.hessian.micro
Class MicroHessianInput
java.lang.Object
com.caucho.hessian.micro.MicroHessianInput
Input stream for Hessian requests, compatible with microedition
Java. It only uses classes and types available to J2ME. In
particular, it does not have any support for the <double> type.
MicroHessianInput does not depend on any classes other than in J2ME, so it can be extracted independently into a smaller package.
MicroHessianInput is unbuffered, so any client needs to provide its own buffering.
InputStream is = ...; // from http connection MicroHessianInput in = new MicroHessianInput(is); String value; in.startReply(); // read reply header value = in.readString(); // read string value in.completeReply(); // read reply footer
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates an uninitialized Hessian input stream.Creates a new Hessian input stream, initialized with an underlying input stream. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Completes reading the callprotected IOException
void
init
(InputStream is) Initialize the hessian stream with the underlying input stream.protected IOException
protocolException
(String message) boolean
Reads a booleanbyte[]
Reads a byte arrayint
readInt()
Reads an integerlong
readLong()
Reads a longreadObject
(Class expectedClass) Reads an arbitrary object the input stream.Reads a stringprotected String
readStringImpl
(int length) Reads a string from the underlying stream.long
Reads a date.void
Starts reading the reply
-
Field Details
-
is
-
-
Constructor Details
-
MicroHessianInput
Creates a new Hessian input stream, initialized with an underlying input stream.- Parameters:
is
- the underlying input stream.
-
MicroHessianInput
public MicroHessianInput()Creates an uninitialized Hessian input stream.
-
-
Method Details
-
init
Initialize the hessian stream with the underlying input stream. -
startReply
Starts reading the replyA successful completion will have a single value:
r x01 x00
- Throws:
IOException
-
completeReply
Completes reading the callA successful completion will have a single value:
z
- Throws:
IOException
-
readBoolean
Reads a booleanT F
- Throws:
IOException
-
readInt
Reads an integerI b32 b24 b16 b8
- Throws:
IOException
-
readLong
Reads a longL b64 b56 b48 b40 b32 b24 b16 b8
- Throws:
IOException
-
readUTCDate
Reads a date.T b64 b56 b48 b40 b32 b24 b16 b8
- Throws:
IOException
-
readString
Reads a stringS b16 b8 string value
- Throws:
IOException
-
readBytes
Reads a byte arrayB b16 b8 data value
- Throws:
IOException
-
readObject
Reads an arbitrary object the input stream.- Throws:
IOException
-
readStringImpl
Reads a string from the underlying stream.- Throws:
IOException
-
expect
-
protocolException
-