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