|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.acplt.oncrpc.XdrDecodingStream
public abstract class XdrDecodingStream
Defines the abstract base class for all decoding XDR streams. A decoding XDR stream returns data in the form of Java data types which it reads from a data source (for instance, network or memory buffer) in the platform-independent XDR format.
Derived classes need to implement the xdrDecodeInt()
,
xdrDecodeOpaque(int)
and
xdrDecodeOpaque(byte[], int, int)
methods to make this complete
mess workable.
Field Summary | |
---|---|
private java.lang.String |
characterEncoding
Encoding to use when deserializing strings or null if
the system's default encoding should be used. |
Constructor Summary | |
---|---|
XdrDecodingStream()
|
Method Summary | |
---|---|
abstract void |
beginDecoding()
Initiates decoding of the next XDR record. |
void |
close()
Closes this decoding XDR stream and releases any system resources associated with this stream. |
void |
endDecoding()
End decoding of the current XDR record. |
java.lang.String |
getCharacterEncoding()
Get the character encoding for deserializing strings. |
abstract java.net.InetAddress |
getSenderAddress()
Returns the Internet address of the sender of the current XDR data. |
abstract int |
getSenderPort()
Returns the port number of the sender of the current XDR data. |
void |
setCharacterEncoding(java.lang.String characterEncoding)
Set the character encoding for deserializing strings. |
boolean |
xdrDecodeBoolean()
Decodes (aka "deserializes") a boolean read from a XDR stream. |
boolean[] |
xdrDecodeBooleanFixedVector(int length)
Decodes (aka "deserializes") a vector of booleans read from a XDR stream. |
boolean[] |
xdrDecodeBooleanVector()
Decodes (aka "deserializes") a vector of booleans read from a XDR stream. |
byte |
xdrDecodeByte()
Decodes (aka "deserializes") a byte read from this XDR stream. |
byte[] |
xdrDecodeByteFixedVector(int length)
Decodes (aka "deserializes") a vector of bytes, which is nothing more than a series of octets (or 8 bits wide bytes), each packed into its very own 4 bytes (XDR int). |
byte[] |
xdrDecodeByteVector()
Decodes (aka "deserializes") a vector of bytes, which is nothing more than a series of octets (or 8 bits wide bytes), each packed into its very own 4 bytes (XDR int). |
double |
xdrDecodeDouble()
Decodes (aka "deserializes") a double (which is a 64 bits wide floating point entity) read from a XDR stream. |
double[] |
xdrDecodeDoubleFixedVector(int length)
Decodes (aka "deserializes") a vector of doubles read from a XDR stream. |
double[] |
xdrDecodeDoubleVector()
Decodes (aka "deserializes") a vector of doubles read from a XDR stream. |
byte[] |
xdrDecodeDynamicOpaque()
Decodes (aka "deserializes") a XDR opaque value, which is represented by a vector of byte values. |
float |
xdrDecodeFloat()
Decodes (aka "deserializes") a float (which is a 32 bits wide floating point entity) read from a XDR stream. |
float[] |
xdrDecodeFloatFixedVector(int length)
Decodes (aka "deserializes") a vector of floats read from a XDR stream. |
float[] |
xdrDecodeFloatVector()
Decodes (aka "deserializes") a vector of floats read from a XDR stream. |
abstract int |
xdrDecodeInt()
Decodes (aka "deserializes") a "XDR int" value received from a XDR stream. |
int[] |
xdrDecodeIntFixedVector(int length)
Decodes (aka "deserializes") a vector of ints read from a XDR stream. |
int[] |
xdrDecodeIntVector()
Decodes (aka "deserializes") a vector of ints read from a XDR stream. |
long |
xdrDecodeLong()
Decodes (aka "deserializes") a long (which is called a "hyper" in XDR babble and is 64 bits wide) read from a XDR stream. |
long[] |
xdrDecodeLongFixedVector(int length)
Decodes (aka "deserializes") a vector of longs read from a XDR stream. |
long[] |
xdrDecodeLongVector()
Decodes (aka "deserializes") a vector of longs read from a XDR stream. |
void |
xdrDecodeOpaque(byte[] opaque)
Decodes (aka "deserializes") a XDR opaque value, which is represented by a vector of byte values. |
abstract void |
xdrDecodeOpaque(byte[] opaque,
int offset,
int length)
Decodes (aka "deserializes") a XDR opaque value, which is represented by a vector of byte values, and starts at offset with a
length of length . |
abstract byte[] |
xdrDecodeOpaque(int length)
Decodes (aka "deserializes") an opaque value, which is nothing more than a series of octets (or 8 bits wide bytes). |
short |
xdrDecodeShort()
Decodes (aka "deserializes") a short (which is a 16 bit quantity) read from this XDR stream. |
short[] |
xdrDecodeShortFixedVector(int length)
Decodes (aka "deserializes") a vector of short integers read from a XDR stream. |
short[] |
xdrDecodeShortVector()
Decodes (aka "deserializes") a vector of short integers read from a XDR stream. |
java.lang.String |
xdrDecodeString()
Decodes (aka "deserializes") a string read from a XDR stream. |
java.lang.String[] |
xdrDecodeStringFixedVector(int length)
Decodes (aka "deserializes") a vector of strings read from a XDR stream. |
java.lang.String[] |
xdrDecodeStringVector()
Decodes (aka "deserializes") a vector of strings read from a XDR stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String characterEncoding
null
if
the system's default encoding should be used.
Constructor Detail |
---|
public XdrDecodingStream()
Method Detail |
---|
public abstract java.net.InetAddress getSenderAddress()
beginDecoding()
, otherwise
it might return stale information.
public abstract int getSenderPort()
beginDecoding()
, otherwise
it might return stale information.
public abstract void beginDecoding() throws OncRpcException, java.io.IOException
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public void endDecoding() throws OncRpcException, java.io.IOException
endDecoding
is that calling it is an indication that
the current record is no more interesting to the caller and any
allocated data for this record can be freed.
The endDecoding
method of XdrDecodingStream
does nothing.
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public void close() throws OncRpcException, java.io.IOException
close
is that it closes the decoding XDR stream. A closed XDR stream cannot
perform decoding operations and cannot be reopened.
The close
method of XdrDecodingStream
does nothing.
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public abstract int xdrDecodeInt() throws OncRpcException, java.io.IOException
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public abstract byte[] xdrDecodeOpaque(int length) throws OncRpcException, java.io.IOException
Note that this is a basic abstract method, which needs to be implemented in derived classes.
length
- Length of opaque data to decode.
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public abstract void xdrDecodeOpaque(byte[] opaque, int offset, int length) throws OncRpcException, java.io.IOException
offset
with a
length of length
. Only the opaque value is decoded, so the
caller has to know how long the opaque value will be. The decoded data
is always padded to be a multiple of four (because that's what the
sender does).
Derived classes must ensure that the proper semantic is maintained.
opaque
- Byte vector which will receive the decoded opaque value.offset
- Start offset in the byte vector.length
- the number of bytes to decode.
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.
java.lang.IndexOutOfBoundsException
- if the given opaque
byte vector isn't large enough to receive the result.public final void xdrDecodeOpaque(byte[] opaque) throws OncRpcException, java.io.IOException
opaque
- Byte vector which will receive the decoded opaque value.
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final byte[] xdrDecodeDynamicOpaque() throws OncRpcException, java.io.IOException
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final byte[] xdrDecodeByteVector() throws OncRpcException, java.io.IOException
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final byte[] xdrDecodeByteFixedVector(int length) throws OncRpcException, java.io.IOException
length
- of vector to read.
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final byte xdrDecodeByte() throws OncRpcException, java.io.IOException
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final short xdrDecodeShort() throws OncRpcException, java.io.IOException
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final long xdrDecodeLong() throws OncRpcException, java.io.IOException
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final float xdrDecodeFloat() throws OncRpcException, java.io.IOException
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final double xdrDecodeDouble() throws OncRpcException, java.io.IOException
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final boolean xdrDecodeBoolean() throws OncRpcException, java.io.IOException
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final java.lang.String xdrDecodeString() throws OncRpcException, java.io.IOException
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final short[] xdrDecodeShortVector() throws OncRpcException, java.io.IOException
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final short[] xdrDecodeShortFixedVector(int length) throws OncRpcException, java.io.IOException
length
- of vector to read.
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final int[] xdrDecodeIntVector() throws OncRpcException, java.io.IOException
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final int[] xdrDecodeIntFixedVector(int length) throws OncRpcException, java.io.IOException
length
- of vector to read.
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final long[] xdrDecodeLongVector() throws OncRpcException, java.io.IOException
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final long[] xdrDecodeLongFixedVector(int length) throws OncRpcException, java.io.IOException
length
- of vector to read.
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final float[] xdrDecodeFloatVector() throws OncRpcException, java.io.IOException
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final float[] xdrDecodeFloatFixedVector(int length) throws OncRpcException, java.io.IOException
length
- of vector to read.
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final double[] xdrDecodeDoubleVector() throws OncRpcException, java.io.IOException
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final double[] xdrDecodeDoubleFixedVector(int length) throws OncRpcException, java.io.IOException
length
- of vector to read.
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final boolean[] xdrDecodeBooleanVector() throws OncRpcException, java.io.IOException
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final boolean[] xdrDecodeBooleanFixedVector(int length) throws OncRpcException, java.io.IOException
length
- of vector to read.
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final java.lang.String[] xdrDecodeStringVector() throws OncRpcException, java.io.IOException
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public final java.lang.String[] xdrDecodeStringFixedVector(int length) throws OncRpcException, java.io.IOException
length
- of vector to read.
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.public void setCharacterEncoding(java.lang.String characterEncoding)
characterEncoding
- the encoding to use for deserializing strings.
If null
, the system's default encoding is to be used.public java.lang.String getCharacterEncoding()
null
, then the system's default encoding is used.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |