|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
org.objectweb.jeremie.libs.presentation.std.StdMarshallerFactory.StdUnMarshaller
StdUnMarshaller is an (abstract) implementation of UnMarshaller.
Field Summary | |
protected org.objectweb.jonathan.apis.kernel.Context |
context
|
protected Chunk |
first
|
protected java.io.ObjectInputStream |
is
|
protected int |
last_offset
|
protected boolean |
little_endian
|
protected int |
offset
|
Constructor Summary | |
protected |
StdMarshallerFactory.StdUnMarshaller(Chunk first,
int read)
|
Method Summary | |
int |
available()
Returns the number of bytes that can be read without blocking. |
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. |
protected void |
prepare()
|
int |
read()
Reads one byte from the message. |
int |
read(byte[] array,
int off,
int length)
Reads data from the message into an array of bytes. |
boolean |
readBoolean()
Reads a boolean from a message. |
byte |
readByte()
Reads a byte from a message. |
void |
readByteArray(byte[] array,
int off,
int len)
Reads an array of bytes. |
char |
readChar16()
Reads a 16 bits char. |
char |
readChar8()
Reads a char from a message. |
double |
readDouble()
Reads a double. |
java.lang.Exception |
readException()
Reads an exception thrown by a remote method invocation from an underlying stream. |
float |
readFloat()
Reads a float. |
int |
readInt()
Reads an int. |
long |
readLong()
Reads a long. |
java.lang.reflect.Method |
readMethod(java.lang.Class objclass)
Reads a method from an underlying stream. |
java.lang.Object[] |
readParameters()
Reads the arguments in a remote method invocation from an underlying stream. |
java.lang.Object |
readReference()
Method used by stubs when they need to send interfaces references. |
java.lang.Object |
readResult()
Reads the result of a remote method invocation from an underlying stream. |
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. |
long |
skip(long n)
Skips over and discards n bytes of data from this input stream. |
Methods inherited from class java.io.InputStream |
mark, markSupported, read, reset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Chunk first
protected int offset
protected int last_offset
protected boolean little_endian
protected java.io.ObjectInputStream is
protected org.objectweb.jonathan.apis.kernel.Context context
Constructor Detail |
protected StdMarshallerFactory.StdUnMarshaller(Chunk first, int read)
Method Detail |
public final org.objectweb.jonathan.apis.kernel.Context getContext()
UnMarshaller
Context
associated with this unmarshaller.
getContext
in interface UnMarshaller
Context
associated with this unmarshaller.public void close()
UnMarshaller
close
in interface UnMarshaller
public void setSize(int size) throws org.objectweb.jonathan.apis.kernel.JonathanException
UnMarshaller
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.
setSize
in interface UnMarshaller
size
- the expected number of readable bytes.
org.objectweb.jonathan.apis.kernel.JonathanException
- if something goes wrong.public byte readByte() throws org.objectweb.jonathan.apis.kernel.JonathanException
readByte
in interface UnMarshaller
org.objectweb.jonathan.apis.kernel.JonathanException
- if an IO exception occurs.public boolean readBoolean() throws org.objectweb.jonathan.apis.kernel.JonathanException
readBoolean
in interface UnMarshaller
org.objectweb.jonathan.apis.kernel.JonathanException
- if an IO exception occurs.public char readChar8() throws org.objectweb.jonathan.apis.kernel.JonathanException
readChar8
in interface UnMarshaller
org.objectweb.jonathan.apis.kernel.JonathanException
- if an IO exception occurs.public char readChar16() throws org.objectweb.jonathan.apis.kernel.JonathanException
UnMarshaller
readChar16
in interface UnMarshaller
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
UnMarshaller
readShort
in interface UnMarshaller
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
UnMarshaller
readInt
in interface UnMarshaller
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
UnMarshaller
readLong
in interface UnMarshaller
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
UnMarshaller
readFloat
in interface UnMarshaller
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
UnMarshaller
readDouble
in interface UnMarshaller
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
UnMarshaller
readString8
in interface UnMarshaller
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
UnMarshaller
readString16
in interface UnMarshaller
org.objectweb.jonathan.apis.kernel.JonathanException
- if the format of the data is incompatible
with the request.public final java.lang.Object readReference() throws org.objectweb.jonathan.apis.kernel.JonathanException
readReference
in interface UnMarshaller
org.objectweb.jonathan.apis.kernel.JonathanException
- if the format of the data is incompatible
with the request.public final java.lang.Object readValue() throws org.objectweb.jonathan.apis.kernel.JonathanException
UnMarshaller
readValue
in interface UnMarshaller
org.objectweb.jonathan.apis.kernel.JonathanException
- if the format of the data is incompatible
with the request.public void readByteArray(byte[] array, int off, int len) throws org.objectweb.jonathan.apis.kernel.JonathanException
UnMarshaller
readByteArray
in interface UnMarshaller
array
- a byte array (of size >= offset + len)off
- 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.lang.reflect.Method readMethod(java.lang.Class objclass) throws java.rmi.UnmarshalException
JRMIUnMarshaller
readMethod
in interface JRMIUnMarshaller
objclass
- a class that declares the method.
java.rmi.UnmarshalException
- if something goes wrong.public java.lang.Object[] readParameters() throws java.rmi.UnmarshalException
JRMIUnMarshaller
readParameters
in interface JRMIUnMarshaller
java.rmi.UnmarshalException
- if something goes wrong.public java.lang.Object readResult() throws java.rmi.UnmarshalException
JRMIUnMarshaller
readResult
in interface JRMIUnMarshaller
java.rmi.UnmarshalException
- if something goes wrong.public java.lang.Exception readException() throws java.rmi.UnmarshalException
JRMIUnMarshaller
readException
in interface JRMIUnMarshaller
java.rmi.UnmarshalException
- if something goes wrong.public final boolean isLittleEndian()
isLittleEndian
in interface UnMarshaller
public void setByteOrder(boolean little_endian)
UnMarshaller
isLittleEndian
) of
the target unmarshaller
setByteOrder
in interface UnMarshaller
little_endian
- the new byte order.public java.io.InputStream inputStream()
UnMarshaller
inputStream
in interface UnMarshaller
public int read() throws java.io.IOException
java.io.IOException
- if an error occurs.ChunkProvider
public int read(byte[] array, int off, int length) throws java.io.IOException
readByteArray()
method.
array
- the buffer into which the data is read.
java.io.IOException
- if an error occurs.public long skip(long n) throws java.io.IOException
The default implementation calls the skip(int) method.
n
- the number of bytes to be skipped.
java.io.IOException
- if an I/O error occurs.public int available() throws java.io.IOException
java.io.IOException
- if an error occurs.ChunkProvider
public int bytesRead()
UnMarshaller
bytesRead
in interface UnMarshaller
protected void prepare() throws org.objectweb.jonathan.apis.kernel.JonathanException
org.objectweb.jonathan.apis.kernel.JonathanException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |