|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
org.objectweb.fractal.rmi.io.RmiUnMarshaller
An UnMarshaller
that uses an RmiObjectInputStream
to
unmarshall object values.
Field Summary | |
protected ContextFactory |
contextFactory
The context factory used to create the context associated with this marshaller. |
protected NamingContext |
domain
The domain used to instantiate is . |
protected ObjectInputStream |
is
The object input stream used to unmarshall object values. |
Constructor Summary | |
RmiUnMarshaller(NamingContext domain,
ContextFactory contextFactory,
Chunk chunk,
int read)
Constructs a new RmiUnMarshaller . |
|
RmiUnMarshaller(NamingContext domain,
ContextFactory contextFactory,
ChunkProvider provider)
Constructs a new RmiUnMarshaller . |
Method Summary | |
int |
available()
Returns the number of bytes that can be read (or skipped over) from this input stream without blocking. |
int |
bytesRead()
Returns the number of bytes read since the beginning. |
void |
close()
Closes this input stream and releases any system resources associated with the stream. |
Context |
getContext()
Returns a Context associated with this unmarshaller. |
protected void |
initObjectStream()
Instantiates the delegate object input stream is . |
InputStream |
inputStream()
Returns an input stream to read data from the unmarshaller. |
boolean |
isLittleEndian()
Returns true if this unmarshaller is little-endian, false otherwise. |
int |
read()
Reads the next byte of data from the input stream. |
int |
read(byte[] array,
int off,
int length)
Reads up to length bytes of data from the input stream into
an array of bytes. |
boolean |
readBoolean()
Reads a boolean. |
byte |
readByte()
Reads a byte. |
void |
readByteArray(byte[] array,
int off,
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. |
Object |
readReference()
Reads a reference to an object. |
short |
readShort()
Reads a short. |
String |
readString16()
Reads a string composed of 16 bits chars. |
String |
readString8()
Reads a string composed of 8 bits chars. |
Object |
readValue()
Reads a value. |
void |
setByteOrder(boolean littleEndian)
Sets the byte order of this 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 NamingContext domain
is
.
protected ContextFactory contextFactory
getContext
.
protected ObjectInputStream is
readValue
or to readReference
.
Constructor Detail |
public RmiUnMarshaller(NamingContext domain, ContextFactory contextFactory, Chunk chunk, int read)
RmiUnMarshaller
.
domain
- the domain to be used to instantiate is
.contextFactory
- the context factory to be used to create the context
associated with this marshaller.chunk
- a (chain of) chunk(s).read
- the number of bytes already read from the message.public RmiUnMarshaller(NamingContext domain, ContextFactory contextFactory, ChunkProvider provider)
RmiUnMarshaller
.
domain
- the domain to be used to instantiate is
.contextFactory
- the context factory to be used to create the context
associated with this marshaller.provider
- a chunk provider.Method Detail |
public boolean isLittleEndian()
isLittleEndian
in interface UnMarshaller
public void setByteOrder(boolean littleEndian)
setByteOrder
in interface UnMarshaller
littleEndian
- the new byte order.public final Context getContext()
Context
associated with this unmarshaller.
getContext
in interface UnMarshaller
Context
associated with this unmarshaller.public int bytesRead()
bytesRead
in interface UnMarshaller
public void setSize(int size) throws JonathanException
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.
JonathanException
- if something goes wrong.public InputStream inputStream()
inputStream
in interface UnMarshaller
public byte readByte() throws JonathanException
readByte
in interface UnMarshaller
JonathanException
- if the format of the data is incompatible with
the request.public boolean readBoolean() throws JonathanException
readBoolean
in interface UnMarshaller
JonathanException
- if the format of the data is incompatible with
the request.public char readChar8() throws JonathanException
readChar8
in interface UnMarshaller
JonathanException
- if the format of the data is incompatible with
the request.public char readChar16() throws JonathanException
readChar16
in interface UnMarshaller
JonathanException
- if the format of the data is incompatible with
the request.public short readShort() throws JonathanException
readShort
in interface UnMarshaller
JonathanException
- if the format of the data is incompatible with
the request.public int readInt() throws JonathanException
readInt
in interface UnMarshaller
JonathanException
- if the format of the data is incompatible with
the request.public float readFloat() throws JonathanException
readFloat
in interface UnMarshaller
JonathanException
- if the format of the data is incompatible with
the request.public long readLong() throws JonathanException
readLong
in interface UnMarshaller
JonathanException
- if the format of the data is incompatible with
the request.public double readDouble() throws JonathanException
readDouble
in interface UnMarshaller
JonathanException
- if the format of the data is incompatible with
the request.public String readString8() throws JonathanException
readString8
in interface UnMarshaller
JonathanException
- if the format of the data is incompatible with
the request.public String readString16() throws JonathanException
readString16
in interface UnMarshaller
JonathanException
- if the format of the data is incompatible with
the request.public void readByteArray(byte[] array, int off, int len) throws JonathanException
readByteArray
in interface UnMarshaller
array
- a byte array (of size >= offset + len).off
- the position (in array) of the first byte to write.len
- the total number of bytes to read.
JonathanException
- if the format of the data is incompatible with
the request.public Object readReference() throws JonathanException
readReference
in interface UnMarshaller
JonathanException
- if the format of the data is incompatible with
the request.public Object readValue() throws JonathanException
readValue
in interface UnMarshaller
JonathanException
- if the format of the data is incompatible with
the request.public int available() throws IOException
IOException
public int read() throws IOException
IOException
public int read(byte[] array, int off, int length) throws IOException
length
bytes of data from the input stream into
an array of bytes.
IOException
public long skip(long n) throws IOException
n
bytes of data from this input
stream.
IOException
public void close()
close
in interface UnMarshaller
protected void initObjectStream() throws IOException
is
. This
method creates RmiObjectInputStream
stream.
IOException
- if the delegate object input stream cannot be created.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |