public class XdrTcpChannelEncodingStream extends XdrEncodingStream
| Constructor and Description |
|---|
XdrTcpChannelEncodingStream(SocketChannel tcpChannel,
int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
beginEncoding(InetAddress receiverAddress,
int receiverPort)
Begins encoding a new XDR record.
|
void |
endEncoding()
Flushes this encoding XDR stream and forces any buffered output bytes
to be written out.
|
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. |
close, getCharacterEncoding, setCharacterEncoding, 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, xdrEncodeStringVectorpublic XdrTcpChannelEncodingStream(SocketChannel tcpChannel, int bufferSize)
public void beginEncoding(InetAddress receiverAddress, int receiverPort) throws OncRpcException, IOException
XdrEncodingStreambeginEncoding in class XdrEncodingStreamreceiverAddress - 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.OncRpcException - if an ONC/RPC error occurs.IOException - if an I/O error occurs.public void endEncoding()
throws OncRpcException,
IOException
XdrEncodingStreamendEncoding 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.
The endEncoding method of XdrEncodingStream
does nothing.
endEncoding in class XdrEncodingStreamOncRpcException - if an ONC/RPC error occurs.IOException - if an I/O error occurs.public void xdrEncodeInt(int value)
throws OncRpcException,
IOException
XdrEncodingStreamxdrEncodeInt in class XdrEncodingStreamvalue - The int value to be encoded.OncRpcException - if an ONC/RPC error occurs.IOException - if an I/O error occurs.public void xdrEncodeOpaque(byte[] value,
int offset,
int length)
throws OncRpcException,
IOException
XdrEncodingStreamoffset 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.
Derived classes must ensure that the proper semantic is maintained.
xdrEncodeOpaque in class XdrEncodingStreamvalue - The opaque value to be encoded in the form of a series of
bytes.offset - Start offset in the data.length - the number of bytes to encode.OncRpcException - if an ONC/RPC error occurs.IOException - if an I/O error occurs.Copyright © 2025. All rights reserved.