public class MicroHessianInput extends Object
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
| Modifier and Type | Field and Description |
|---|---|
protected InputStream |
is |
| Constructor and Description |
|---|
MicroHessianInput()
Creates an uninitialized Hessian input stream.
|
MicroHessianInput(InputStream is)
Creates a new Hessian input stream, initialized with an
underlying input stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
completeReply()
Completes reading the call
|
protected IOException |
expect(String expect,
int ch) |
void |
init(InputStream is)
Initialize the hessian stream with the underlying input stream.
|
protected IOException |
protocolException(String message) |
boolean |
readBoolean()
Reads a boolean
|
byte[] |
readBytes()
Reads a byte array
|
int |
readInt()
Reads an integer
|
long |
readLong()
Reads a long
|
Object |
readObject(Class expectedClass)
Reads an arbitrary object the input stream.
|
String |
readString()
Reads a string
|
protected String |
readStringImpl(int length)
Reads a string from the underlying stream.
|
long |
readUTCDate()
Reads a date.
|
void |
startReply()
Starts reading the reply
|
protected InputStream is
public MicroHessianInput(InputStream is)
is - the underlying input stream.public MicroHessianInput()
public void init(InputStream is)
public void startReply()
throws IOException
A successful completion will have a single value:
r x01 x00
IOExceptionpublic void completeReply()
throws IOException
A successful completion will have a single value:
z
IOExceptionpublic boolean readBoolean()
throws IOException
T F
IOExceptionpublic int readInt()
throws IOException
I b32 b24 b16 b8
IOExceptionpublic long readLong()
throws IOException
L b64 b56 b48 b40 b32 b24 b16 b8
IOExceptionpublic long readUTCDate()
throws IOException
T b64 b56 b48 b40 b32 b24 b16 b8
IOExceptionpublic String readString() throws IOException
S b16 b8 string value
IOExceptionpublic byte[] readBytes()
throws IOException
B b16 b8 data value
IOExceptionpublic Object readObject(Class expectedClass) throws IOException
IOExceptionprotected String readStringImpl(int length) throws IOException
IOExceptionprotected IOException expect(String expect, int ch)
protected IOException protocolException(String message)
Copyright © 2017 Caucho Technology, Inc. All rights reserved.