|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
org.omg.CORBA.portable.InputStream
org.omg.CORBA_2_3.portable.InputStream
org.objectweb.david.apis.presentation.DavidInputStream
org.objectweb.david.libs.presentation.portable.PortableMarshallerFactory.PortableUnMarshaller
PortableUnMarshaller is an implementation of UnMarshaller.
Field Summary | |
protected Chunk |
first
The first chunk in the message, i.e., the one data are read from. |
protected int |
last_offset
last_offset is such that last_offset +
offset is equal to the number of bytes read since the
beginning of the reading process. |
protected boolean |
little_endian
If true, the target unmarshaller expects a little endian encoding of data. |
protected int |
offset
offset of the next byte to read in first |
Constructor Summary | |
protected |
PortableMarshallerFactory.PortableUnMarshaller(Chunk first,
int read)
Creates a new unmarshaller. |
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). |
void |
endEncapsulation(int encapsulation_spec)
|
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()
When nothing can be read from the current chunk, this method tries to get a new chunk to read data from. |
java.lang.Object |
read_abstract_interface()
|
java.lang.Object |
read_abstract_interface(java.lang.Class clz)
|
org.omg.CORBA.Any |
read_any()
|
void |
read_boolean_array(boolean[] array,
int off,
int len)
|
boolean |
read_boolean()
|
void |
read_char_array(char[] array,
int off,
int len)
|
char |
read_char()
|
void |
read_double_array(double[] array,
int off,
int len)
|
double |
read_double()
|
void |
read_float_array(float[] array,
int off,
int len)
|
float |
read_float()
|
void |
read_long_array(int[] array,
int off,
int len)
|
int |
read_long()
|
void |
read_longlong_array(long[] array,
int off,
int len)
|
long |
read_longlong()
|
org.omg.CORBA.Object |
read_Object()
|
org.omg.CORBA.Object |
read_Object(java.lang.Class classe)
|
void |
read_octet_array(byte[] array,
int off,
int len)
|
byte |
read_octet()
|
void |
read_short_array(short[] array,
int off,
int len)
|
short |
read_short()
|
java.lang.String |
read_string()
|
org.omg.CORBA.TypeCode |
read_TypeCode()
|
void |
read_ulong_array(int[] array,
int off,
int len)
|
int |
read_ulong()
|
void |
read_ulonglong_array(long[] array,
int off,
int len)
|
long |
read_ulonglong()
|
void |
read_ushort_array(short[] array,
int off,
int len)
|
short |
read_ushort()
|
java.io.Serializable |
read_value()
|
java.io.Serializable |
read_value(org.omg.CORBA.portable.BoxedValueHelper factory)
|
java.io.Serializable |
read_value(java.lang.Class clz)
|
java.io.Serializable |
read_value(java.io.Serializable value)
|
java.io.Serializable |
read_value(java.lang.String rep_id)
|
void |
read_wchar_array(char[] array,
int off,
int len)
|
char |
read_wchar()
|
java.lang.String |
read_wstring()
|
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. |
float |
readFloat()
Reads a float. |
int |
readInt()
Reads an int. |
long |
readLong()
Reads a long. |
java.lang.Object |
readReference()
Method used by stubs when they need to send interfaces references. |
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 new_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. |
protected void |
skipPadding(int constraint)
|
int |
startEncapsulation()
|
Methods inherited from class org.objectweb.david.apis.presentation.DavidInputStream |
read_Principal |
Methods inherited from class org.omg.CORBA.portable.InputStream |
orb, read_Context, read_fixed |
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
first
protected int last_offset
last_offset
is such that last_offset
+
offset
is equal to the number of bytes read since the
beginning of the reading process.
protected boolean little_endian
Constructor Detail |
protected PortableMarshallerFactory.PortableUnMarshaller(Chunk first, int read)
first
- the (chain of) chunk(s) to read data from;read
- the number of already read bytes (used to initialize
last_offset
.Method Detail |
public void close()
UnMarshaller
close
in interface UnMarshaller
close
in class DavidInputStream
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()
readReference
in interface UnMarshaller
public final java.lang.Object readValue()
UnMarshaller
readValue
in interface UnMarshaller
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 final boolean isLittleEndian()
isLittleEndian
in interface UnMarshaller
public void setByteOrder(boolean new_little_endian)
UnMarshaller
isLittleEndian
) of
the target unmarshaller
setByteOrder
in interface UnMarshaller
new_little_endian
- the new byte order.public java.io.InputStream inputStream()
UnMarshaller
inputStream
in interface UnMarshaller
public boolean read_boolean()
public char read_char()
public char read_wchar()
public byte read_octet()
public short read_short()
public short read_ushort()
public int read_long()
public int read_ulong()
public long read_longlong()
public long read_ulonglong()
public float read_float()
public double read_double()
public java.lang.String read_string()
public java.lang.String read_wstring()
public void read_boolean_array(boolean[] array, int off, int len)
public void read_char_array(char[] array, int off, int len)
public void read_wchar_array(char[] array, int off, int len)
public void read_octet_array(byte[] array, int off, int len)
public void read_short_array(short[] array, int off, int len)
public void read_ushort_array(short[] array, int off, int len)
public void read_long_array(int[] array, int off, int len)
public void read_ulong_array(int[] array, int off, int len)
public void read_longlong_array(long[] array, int off, int len)
public void read_ulonglong_array(long[] array, int off, int len)
public void read_float_array(float[] array, int off, int len)
public void read_double_array(double[] array, int off, int len)
public org.omg.CORBA.Object read_Object()
public org.omg.CORBA.Object read_Object(java.lang.Class classe)
public org.omg.CORBA.Any read_any()
public org.omg.CORBA.TypeCode read_TypeCode()
public java.io.Serializable read_value()
public java.io.Serializable read_value(java.lang.String rep_id)
public java.io.Serializable read_value(java.lang.Class clz)
public java.io.Serializable read_value(org.omg.CORBA.portable.BoxedValueHelper factory)
public java.io.Serializable read_value(java.io.Serializable value)
public java.lang.Object read_abstract_interface()
public java.lang.Object read_abstract_interface(java.lang.Class clz)
public int read() throws java.io.IOException
java.io.IOException
- if an error occurs.readByte()
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.public int bytesRead()
UnMarshaller
bytesRead
in interface UnMarshaller
protected void skipPadding(int constraint) throws org.objectweb.jonathan.apis.kernel.JonathanException
org.objectweb.jonathan.apis.kernel.JonathanException
public int startEncapsulation() throws org.objectweb.jonathan.apis.kernel.JonathanException
startEncapsulation
in class DavidInputStream
org.objectweb.jonathan.apis.kernel.JonathanException
public void endEncapsulation(int encapsulation_spec)
endEncapsulation
in class DavidInputStream
public final org.objectweb.jonathan.apis.kernel.Context getContext()
UnMarshaller
Context
associated with this unmarshaller.
getContext
in interface UnMarshaller
Context
associated with this unmarshaller.protected void prepare() throws org.objectweb.jonathan.apis.kernel.JonathanException
org.objectweb.jonathan.apis.kernel.JonathanException
- if something goes wrong.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |