|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
UnMarshaller is the type of basic types unmarshallers. It should be used by protocols.
Method Summary | |
int |
bytesRead()
Returns the number of bytes read since the beginning. |
void |
close()
Closes the target unmarshaller, releasing all underlying resources (including a possible chunk provider). |
org.objectweb.jonathan.apis.kernel.Context |
getContext()
Returns a Context associated with this unmarshaller. |
java.io.InputStream |
inputStream()
Returns an input stream to read data from the unmarshaller. |
boolean |
isLittleEndian()
Returns true if this unmarshaller is little-endian, false otherwise. |
boolean |
readBoolean()
Reads a boolean. |
byte |
readByte()
Reads a byte. |
void |
readByteArray(byte[] array,
int offset,
int len)
Reads an array of bytes. |
char |
readChar16()
Reads a 16 bits char. |
char |
readChar8()
Reads a 8 bits char. |
double |
readDouble()
Reads a double. |
float |
readFloat()
Reads a float. |
int |
readInt()
Reads an int. |
long |
readLong()
Reads a long. |
java.lang.Object |
readReference()
Reads a reference to an object. |
short |
readShort()
Reads a short. |
java.lang.String |
readString16()
Reads a string composed of 16 bits chars. |
java.lang.String |
readString8()
Reads a string composed of 8 bits chars. |
java.lang.Object |
readValue()
Reads a value |
void |
setByteOrder(boolean little_endian)
Sets the byte order (returned by isLittleEndian ) of
the target unmarshaller |
void |
setSize(int size)
Sets the number of bytes readable from the unmarshaller. |
Method Detail |
public byte readByte() throws org.objectweb.jonathan.apis.kernel.JonathanException
org.objectweb.jonathan.apis.kernel.JonathanException
- if the format of the data is incompatible
with the request.public boolean readBoolean() throws org.objectweb.jonathan.apis.kernel.JonathanException
org.objectweb.jonathan.apis.kernel.JonathanException
- if the format of the data is incompatible
with the request.public char readChar8() throws org.objectweb.jonathan.apis.kernel.JonathanException
org.objectweb.jonathan.apis.kernel.JonathanException
- if the format of the data is incompatible
with the request.public char readChar16() throws org.objectweb.jonathan.apis.kernel.JonathanException
org.objectweb.jonathan.apis.kernel.JonathanException
- if the format of the data is incompatible
with the request.public short readShort() throws org.objectweb.jonathan.apis.kernel.JonathanException
org.objectweb.jonathan.apis.kernel.JonathanException
- if the format of the data is incompatible
with the request.public int readInt() throws org.objectweb.jonathan.apis.kernel.JonathanException
org.objectweb.jonathan.apis.kernel.JonathanException
- if the format of the data is incompatible
with the request.public long readLong() throws org.objectweb.jonathan.apis.kernel.JonathanException
org.objectweb.jonathan.apis.kernel.JonathanException
- if the format of the data is incompatible
with the request.public float readFloat() throws org.objectweb.jonathan.apis.kernel.JonathanException
org.objectweb.jonathan.apis.kernel.JonathanException
- if the format of the data is incompatible
with the request.public double readDouble() throws org.objectweb.jonathan.apis.kernel.JonathanException
org.objectweb.jonathan.apis.kernel.JonathanException
- if the format of the data is incompatible
with the request.public java.lang.String readString8() throws org.objectweb.jonathan.apis.kernel.JonathanException
org.objectweb.jonathan.apis.kernel.JonathanException
- if the format of the data is incompatible
with the request.public java.lang.String readString16() throws org.objectweb.jonathan.apis.kernel.JonathanException
org.objectweb.jonathan.apis.kernel.JonathanException
- if the format of the data is incompatible
with the request.public java.lang.Object readReference() throws org.objectweb.jonathan.apis.kernel.JonathanException
org.objectweb.jonathan.apis.kernel.JonathanException
- if the format of the data is incompatible
with the request.public java.lang.Object readValue() throws org.objectweb.jonathan.apis.kernel.JonathanException
org.objectweb.jonathan.apis.kernel.JonathanException
- if the format of the data is incompatible
with the request.public void readByteArray(byte[] array, int offset, int len) throws org.objectweb.jonathan.apis.kernel.JonathanException
array
- a byte array (of size >= offset + len)offset
- the position (in array) of the first byte to writelen
- the total number of bytes to read;
org.objectweb.jonathan.apis.kernel.JonathanException
- if the format of the data is incompatible
with the request.public java.io.InputStream inputStream()
public boolean isLittleEndian()
public void setByteOrder(boolean little_endian)
isLittleEndian
) of
the target unmarshaller
little_endian
- the new byte order.public int bytesRead()
public void setSize(int size) throws org.objectweb.jonathan.apis.kernel.JonathanException
Once this method has been called, it won't be possible to read more than the
size
specified bytes from this unmarshaller. Knowing the exact
number of readable bytes lets the unmarshaller free the resources (such as
a chunk provider) that won't be used. This method may block until the
expected number of bytes is readable.
size
- the expected number of readable bytes.
org.objectweb.jonathan.apis.kernel.JonathanException
- if something goes wrong.public void close()
public org.objectweb.jonathan.apis.kernel.Context getContext()
Context
associated with this unmarshaller.
Context
associated with this unmarshaller.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |