|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.acplt.oncrpc.XdrDecodingStream
bamboo.util.XdrInputBufferDecodingStream
public class XdrInputBufferDecodingStream
The XdrBufferDecodingStream class provides the necessary
functionality to XdrDecodingStream to retrieve XDR packets from
a ostore.util.InputBuffer. Cribbed by Sean Rhea from the class
org.acplt.oncrpc.XdrBufferDecodingStream.
| Constructor Summary | |
|---|---|
XdrInputBufferDecodingStream(ostore.util.InputBuffer buffer,
int encodedLength)
Construct a new XdrUdpDecodingStream object and associate
it with a buffer containing encoded XDR data. |
|
| Method Summary | |
|---|---|
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. |
InetAddress |
getSenderAddress()
Returns the Internet address of the sender of the current XDR data. |
int |
getSenderPort()
Returns the port number of the sender of the current XDR data. |
void |
setXdrData(ostore.util.InputBuffer buffer,
int encodedLength)
Sets the buffer containing encoded XDR data as well as the length of the encoded data. |
int |
xdrDecodeInt()
Decodes (aka "deserializes") a "XDR int" value received from a XDR stream. |
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. |
byte[] |
xdrDecodeOpaque(int length)
Decodes (aka "deserializes") an opaque value, which is nothing more than a series of octets (or 8 bits wide bytes). |
| Methods inherited from class org.acplt.oncrpc.XdrDecodingStream |
|---|
xdrDecodeBoolean, xdrDecodeBooleanFixedVector, xdrDecodeBooleanVector, xdrDecodeByte, xdrDecodeByteFixedVector, xdrDecodeByteVector, xdrDecodeDouble, xdrDecodeDoubleFixedVector, xdrDecodeDoubleVector, xdrDecodeDynamicOpaque, xdrDecodeFloat, xdrDecodeFloatFixedVector, xdrDecodeFloatVector, xdrDecodeIntFixedVector, xdrDecodeIntVector, xdrDecodeLong, xdrDecodeLongFixedVector, xdrDecodeLongVector, xdrDecodeOpaque, xdrDecodeShort, xdrDecodeShortFixedVector, xdrDecodeShortVector, xdrDecodeString, xdrDecodeStringFixedVector, xdrDecodeStringVector |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XdrInputBufferDecodingStream(ostore.util.InputBuffer buffer,
int encodedLength)
XdrUdpDecodingStream object and associate
it with a buffer containing encoded XDR data.
buffer - Buffer containing encoded XDR data.encodedLength - Length of encoded XDR data within the buffer.
IllegalArgumentException - if encodedLength is not
a multiple of four.| Method Detail |
|---|
public void setXdrData(ostore.util.InputBuffer buffer,
int encodedLength)
buffer - Buffer containing encoded XDR data.encodedLength - Length of encoded XDR data within the buffer.
IllegalArgumentException - if encodedLength is not
a multiple of four.public InetAddress getSenderAddress()
beginDecoding(),
otherwise it might return stale information.
getSenderAddress in class org.acplt.oncrpc.XdrDecodingStreampublic int getSenderPort()
beginDecoding(),
otherwise it might return stale information.
getSenderPort in class org.acplt.oncrpc.XdrDecodingStream
public void beginDecoding()
throws org.acplt.oncrpc.OncRpcException,
IOException
beginDecoding in class org.acplt.oncrpc.XdrDecodingStreamorg.acplt.oncrpc.OncRpcException - if an ONC/RPC error occurs.
IOException - if an I/O error occurs.
public void endDecoding()
throws org.acplt.oncrpc.OncRpcException,
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.
This method overrides XdrDecodingStream.endDecoding(). It does nothing
more than resetting the buffer pointer (eeek! a pointer in Java!!!) back
to the begin of an empty buffer, so attempts to decode data will fail
until the buffer is filled again.
endDecoding in class org.acplt.oncrpc.XdrDecodingStreamorg.acplt.oncrpc.OncRpcException - if an ONC/RPC error occurs.
IOException - if an I/O error occurs.
public void close()
throws org.acplt.oncrpc.OncRpcException,
IOException
This implementation frees the allocated buffer.
close in class org.acplt.oncrpc.XdrDecodingStreamorg.acplt.oncrpc.OncRpcException - if an ONC/RPC error occurs.
IOException - if an I/O error occurs.
public int xdrDecodeInt()
throws org.acplt.oncrpc.OncRpcException,
IOException
xdrDecodeInt in class org.acplt.oncrpc.XdrDecodingStreamorg.acplt.oncrpc.OncRpcException - if an ONC/RPC error occurs.
IOException - if an I/O error occurs.
public byte[] xdrDecodeOpaque(int length)
throws org.acplt.oncrpc.OncRpcException,
IOException
xdrDecodeOpaque(byte[], int, int) where
first the length of the opaque value is retrieved from the XDR stream.
xdrDecodeOpaque in class org.acplt.oncrpc.XdrDecodingStreamlength - Length of opaque data to decode.
org.acplt.oncrpc.OncRpcException - if an ONC/RPC error occurs.
IOException - if an I/O error occurs.
public void xdrDecodeOpaque(byte[] opaque,
int offset,
int length)
throws org.acplt.oncrpc.OncRpcException,
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).
xdrDecodeOpaque in class org.acplt.oncrpc.XdrDecodingStreamopaque - Byte vector which will receive the decoded opaque value.offset - Start offset in the byte vector.length - the number of bytes to decode.
org.acplt.oncrpc.OncRpcException - if an ONC/RPC error occurs.
IOException - if an I/O error occurs.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||