|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.acplt.oncrpc.XdrEncodingStream
bamboo.util.XdrByteBufferEncodingStream
public class XdrByteBufferEncodingStream
The XdrBufferEncodingStream class provides a ByteBuffer-based
XDR stream. Cribbed by Sean Rhea from the class
org.acplt.oncrpc.XdrBufferEncodingStream.
| Constructor Summary | |
|---|---|
XdrByteBufferEncodingStream(ByteBuffer buffer)
Constructs a new XdrBufferEncodingStream with a given
buffer. |
|
XdrByteBufferEncodingStream(int bufferSize)
Constructs a new XdrBufferEncodingStream with a buffer
to encode data into of the given size. |
|
| Method Summary | |
|---|---|
void |
beginEncoding(InetAddress receiverAddress,
int receiverPort)
Begins encoding a new XDR record. |
void |
close()
Closes this encoding XDR stream and releases any system resources associated with this stream. |
void |
endEncoding()
Flushes this encoding XDR stream and forces any buffered output bytes to be written out. |
ByteBuffer |
getXdrData()
Returns the buffer holding encoded data. |
int |
getXdrLength()
Returns the amount of encoded data in the buffer. |
void |
xdrEncodeInt(int value)
Encodes (aka "serializes") a "XDR int" value and writes it down a XDR stream. |
void |
xdrEncodeOpaque(byte[] value,
int offset,
int length)
Encodes (aka "serializes") a XDR opaque value, which is represented by a vector of byte values, and starts at offset with a
length of length. |
| Methods inherited from class org.acplt.oncrpc.XdrEncodingStream |
|---|
xdrEncodeBoolean, xdrEncodeBooleanFixedVector, xdrEncodeBooleanVector, xdrEncodeByte, xdrEncodeByteFixedVector, xdrEncodeByteVector, xdrEncodeDouble, xdrEncodeDoubleFixedVector, xdrEncodeDoubleVector, xdrEncodeDynamicOpaque, xdrEncodeFloat, xdrEncodeFloatFixedVector, xdrEncodeFloatVector, xdrEncodeIntFixedVector, xdrEncodeIntVector, xdrEncodeLong, xdrEncodeLongFixedVector, xdrEncodeLongVector, xdrEncodeOpaque, xdrEncodeOpaque, xdrEncodeShort, xdrEncodeShortFixedVector, xdrEncodeShortVector, xdrEncodeString, xdrEncodeStringFixedVector, xdrEncodeStringVector |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XdrByteBufferEncodingStream(int bufferSize)
XdrBufferEncodingStream with a buffer
to encode data into of the given size.
bufferSize - Size of buffer to store encoded data in.public XdrByteBufferEncodingStream(ByteBuffer buffer)
XdrBufferEncodingStream with a given
buffer.
buffer - Buffer to store encoded information in.
IllegalArgumentException - if encodedLength is not
a multiple of four.| Method Detail |
|---|
public int getXdrLength()
public ByteBuffer getXdrData()
public void beginEncoding(InetAddress receiverAddress,
int receiverPort)
throws org.acplt.oncrpc.OncRpcException,
IOException
beginEncoding in class org.acplt.oncrpc.XdrEncodingStreamreceiver - Indicates the receiver of the XDR data. This can be
null for XDR streams connected permanently to a
receiver (like in case of TCP/IP based XDR streams).receiverPort - Port number of the receiver.
org.acplt.oncrpc.OncRpcException - if an ONC/RPC error occurs.
IOException - if an I/O error occurs.
public void endEncoding()
throws org.acplt.oncrpc.OncRpcException,
IOException
endEncoding is that
calling it is an indication that the current record is finished and any
bytes previously encoded should immediately be written to their intended
destination.
endEncoding in class org.acplt.oncrpc.XdrEncodingStreamorg.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
close
is that it closes the encoding XDR stream. A closed XDR stream cannot
perform encoding operations and cannot be reopened.
close in class org.acplt.oncrpc.XdrEncodingStreamorg.acplt.oncrpc.OncRpcException - if an ONC/RPC error occurs.
IOException - if an I/O error occurs.
public void xdrEncodeInt(int value)
throws org.acplt.oncrpc.OncRpcException,
IOException
xdrEncodeInt in class org.acplt.oncrpc.XdrEncodingStreamorg.acplt.oncrpc.OncRpcException - if an ONC/RPC error occurs.
IOException - if an I/O error occurs.
public void xdrEncodeOpaque(byte[] value,
int offset,
int length)
throws org.acplt.oncrpc.OncRpcException,
IOException
offset with a
length of length. Only the opaque value is encoded, but
no length indication is preceeding the opaque value, so the receiver
has to know how long the opaque value will be. The encoded data is
always padded to be a multiple of four. If the given length is not a
multiple of four, zero bytes will be used for padding.
xdrEncodeOpaque in class org.acplt.oncrpc.XdrEncodingStreamorg.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 | ||||||||