Package org.acplt.oncrpc
Class XdrTcpChannelEncodingStream
java.lang.Object
org.acplt.oncrpc.XdrEncodingStream
org.acplt.oncrpc.XdrTcpChannelEncodingStream
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbeginEncoding(InetAddress receiverAddress, int receiverPort) Begins encoding a new XDR record.voidFlushes this encoding XDR stream and forces any buffered output bytes to be written out.voidxdrEncodeInt(int value) Encodes (aka "serializes") a "XDR int" value and writes it down a XDR stream.voidxdrEncodeOpaque(byte[] value, int offset, int length) Encodes (aka "serializes") a XDR opaque value, which is represented by a vector of byte values, and starts atoffsetwith a length oflength.Methods inherited from class org.acplt.oncrpc.XdrEncodingStream
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, xdrEncodeStringVector
-
Constructor Details
-
XdrTcpChannelEncodingStream
-
-
Method Details
-
beginEncoding
public void beginEncoding(InetAddress receiverAddress, int receiverPort) throws OncRpcException, IOException Description copied from class:XdrEncodingStreamBegins encoding a new XDR record. This typically involves resetting this encoding XDR stream back into a known state.- Overrides:
beginEncodingin classXdrEncodingStream- Parameters:
receiverAddress- Indicates the receiver of the XDR data. This can benullfor XDR streams connected permanently to a receiver (like in case of TCP/IP based XDR streams).receiverPort- Port number of the receiver.- Throws:
OncRpcException- if an ONC/RPC error occurs.IOException- if an I/O error occurs.
-
endEncoding
Description copied from class:XdrEncodingStreamFlushes this encoding XDR stream and forces any buffered output bytes to be written out. The general contract ofendEncodingis 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
endEncodingmethod ofXdrEncodingStreamdoes nothing.- Overrides:
endEncodingin classXdrEncodingStream- Throws:
OncRpcException- if an ONC/RPC error occurs.IOException- if an I/O error occurs.
-
xdrEncodeInt
Description copied from class:XdrEncodingStreamEncodes (aka "serializes") a "XDR int" value and writes it down a XDR stream. A XDR int is 32 bits wide -- the same width Java's "int" data type has. This method is one of the basic methods all other methods can rely on. Because it's so basic, derived classes have to implement it.- Specified by:
xdrEncodeIntin classXdrEncodingStream- Parameters:
value- The int value to be encoded.- Throws:
OncRpcException- if an ONC/RPC error occurs.IOException- if an I/O error occurs.
-
xdrEncodeOpaque
public void xdrEncodeOpaque(byte[] value, int offset, int length) throws OncRpcException, IOException Description copied from class:XdrEncodingStreamEncodes (aka "serializes") a XDR opaque value, which is represented by a vector of byte values, and starts atoffsetwith a length oflength. 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.
- Specified by:
xdrEncodeOpaquein classXdrEncodingStream- Parameters:
value- 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.- Throws:
OncRpcException- if an ONC/RPC error occurs.IOException- if an I/O error occurs.
-