C# Class org.acplt.oncrpc.XdrEncodingStream

Defines the abstract base class for all encoding XDR streams.
Defines the abstract base class for all encoding XDR streams. An encoding XDR stream receives data in the form of Java data types and writes it to a data sink (for instance, network or memory buffer) in the platform-independent XDR format.

Derived classes need to implement the xdrEncodeInt(int) , xdrEncodeOpaque(byte[]) and xdrEncodeOpaque(byte[], int, int) methods to make this complete mess workable. Converted to C# using the db4o Sharpen tool.

Exibir arquivo Open project: wespday/RemoteTea.Net Class Usage Examples

Public Methods

Method Description
Close ( ) : void

Closes this encoding XDR stream and releases any system resources associated with this stream.

Closes this encoding XDR stream and releases any system resources associated with this stream. The general contract of close is that it closes the encoding XDR stream. A closed XDR stream cannot perform encoding operations and cannot be reopened.

The close method of XdrEncodingStream does nothing.

beginEncoding ( IPAddress receiverAddress, int receiverPort ) : void

Begins encoding a new XDR record.

Begins encoding a new XDR record. This typically involves resetting this encoding XDR stream back into a known state.

endEncoding ( ) : void

Flushes this encoding XDR stream and forces any buffered output bytes to be written out.

Flushes this encoding XDR stream and forces any buffered output bytes to be written out. The general contract of 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.

The endEncoding method of XdrEncodingStream does nothing.

getCharacterEncoding ( ) : string

Get the character encoding for serializing strings.

Get the character encoding for serializing strings.

setCharacterEncoding ( string characterEncoding ) : void

Set the character encoding for serializing strings.

Set the character encoding for serializing strings.

xdrEncodeBoolean ( bool value ) : void

Encodes (aka "serializes") a boolean and writes it down this XDR stream.

Encodes (aka "serializes") a boolean and writes it down this XDR stream.

xdrEncodeBooleanFixedVector ( Array value, int length ) : void

Encodes (aka "serializes") a vector of booleans and writes it down this XDR stream.

Encodes (aka "serializes") a vector of booleans and writes it down this XDR stream.

xdrEncodeBooleanVector ( Array value ) : void

Encodes (aka "serializes") a vector of booleans and writes it down this XDR stream.

Encodes (aka "serializes") a vector of booleans and writes it down this XDR stream.

xdrEncodeByte ( byte value ) : void

Encodes (aka "serializes") a byte and write it down this XDR stream.

Encodes (aka "serializes") a byte and write it down this XDR stream.

xdrEncodeByteFixedVector ( Array value, int length ) : void

Encodes (aka "serializes") 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).

Encodes (aka "serializes") 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).

xdrEncodeByteVector ( Array value ) : void

Encodes (aka "serializes") 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).

Encodes (aka "serializes") 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 vectors are encoded together with a preceeding length value. This way the receiver doesn't need to know the length of the vector in advance.

xdrEncodeDouble ( double value ) : void

Encodes (aka "serializes") a double (which is a 64 bits wide floating point quantity) and write it down this XDR stream.

Encodes (aka "serializes") a double (which is a 64 bits wide floating point quantity) and write it down this XDR stream.

xdrEncodeDoubleFixedVector ( Array value, int length ) : void

Encodes (aka "serializes") a vector of doubles and writes it down this XDR stream.

Encodes (aka "serializes") a vector of doubles and writes it down this XDR stream.

xdrEncodeDoubleVector ( Array value ) : void

Encodes (aka "serializes") a vector of doubles and writes it down this XDR stream.

Encodes (aka "serializes") a vector of doubles and writes it down this XDR stream.

xdrEncodeDynamicOpaque ( Array value ) : void

Encodes (aka "serializes") a XDR opaque value, which is represented by a vector of byte values.

Encodes (aka "serializes") a XDR opaque value, which is represented by a vector of byte values. The length of the opaque value is written to the XDR stream, so the receiver does not need to know the exact length in advance. The encoded data is always padded to be a multiple of four to maintain XDR alignment.

xdrEncodeFloat ( float value ) : void

Encodes (aka "serializes") a float (which is a 32 bits wide floating point quantity) and write it down this XDR stream.

Encodes (aka "serializes") a float (which is a 32 bits wide floating point quantity) and write it down this XDR stream.

xdrEncodeFloatFixedVector ( Array value, int length ) : void

Encodes (aka "serializes") a vector of floats and writes it down this XDR stream.

Encodes (aka "serializes") a vector of floats and writes it down this XDR stream.

xdrEncodeFloatVector ( Array value ) : void

Encodes (aka "serializes") a vector of floats and writes it down this XDR stream.

Encodes (aka "serializes") a vector of floats and writes it down this XDR stream.

xdrEncodeInt ( int value ) : void

Encodes (aka "serializes") a "XDR int" value and writes it down a XDR stream.

Encodes (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.

xdrEncodeIntFixedVector ( Array value, int length ) : void

Encodes (aka "serializes") a vector of ints and writes it down this XDR stream.

Encodes (aka "serializes") a vector of ints and writes it down this XDR stream.

xdrEncodeIntVector ( Array value ) : void

Encodes (aka "serializes") a vector of ints and writes it down this XDR stream.

Encodes (aka "serializes") a vector of ints and writes it down this XDR stream.

xdrEncodeLong ( long value ) : void

Encodes (aka "serializes") a long (which is called a "hyper" in XDR babble and is 64 bits wide) and write it down this XDR stream.

Encodes (aka "serializes") a long (which is called a "hyper" in XDR babble and is 64 bits wide) and write it down this XDR stream.

xdrEncodeLongFixedVector ( Array value, int length ) : void

Encodes (aka "serializes") a vector of long integers and writes it down this XDR stream.

Encodes (aka "serializes") a vector of long integers and writes it down this XDR stream.

xdrEncodeLongVector ( Array value ) : void

Encodes (aka "serializes") a vector of long integers and writes it down this XDR stream.

Encodes (aka "serializes") a vector of long integers and writes it down this XDR stream.

xdrEncodeOpaque ( Array value ) : void

Encodes (aka "serializes") a XDR opaque value, which is represented by a vector of byte values.

Encodes (aka "serializes") a XDR opaque value, which is represented by a vector of byte values. 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 length of the given byte vector is not a multiple of four, zero bytes will be used for padding.

xdrEncodeOpaque ( Array value, int length ) : void

Encodes (aka "serializes") a XDR opaque value, which is represented by a vector of byte values.

Encodes (aka "serializes") a XDR opaque value, which is represented by a vector of byte values. 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 length of the given byte vector is not a multiple of four, zero bytes will be used for padding.

xdrEncodeOpaque ( Array value, int offset, int length ) : void

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.

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. 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.

xdrEncodeShort ( short value ) : void

Encodes (aka "serializes") a short (which is a 16 bits wide quantity) and write it down this XDR stream.

Encodes (aka "serializes") a short (which is a 16 bits wide quantity) and write it down this XDR stream.

xdrEncodeShortFixedVector ( Array value, int length ) : void

Encodes (aka "serializes") a vector of short integers and writes it down this XDR stream.

Encodes (aka "serializes") a vector of short integers and writes it down this XDR stream.

xdrEncodeShortVector ( Array value ) : void

Encodes (aka "serializes") a vector of short integers and writes it down this XDR stream.

Encodes (aka "serializes") a vector of short integers and writes it down this XDR stream.

xdrEncodeString ( string value ) : void

Encodes (aka "serializes") a string and writes it down this XDR stream.

Encodes (aka "serializes") a string and writes it down this XDR stream.

xdrEncodeStringFixedVector ( Array value, int length ) : void

Encodes (aka "serializes") a vector of strings and writes it down this XDR stream.

Encodes (aka "serializes") a vector of strings and writes it down this XDR stream.

xdrEncodeStringVector ( Array value ) : void

Encodes (aka "serializes") a vector of strings and writes it down this XDR stream.

Encodes (aka "serializes") a vector of strings and writes it down this XDR stream.

Private Methods

Method Description
StrToByteArray ( string str ) : byte[]
StrToByteArray ( string str, Encoding encoding ) : byte[]

Method Details

Close() public method

Closes this encoding XDR stream and releases any system resources associated with this stream.
Closes this encoding XDR stream and releases any system resources associated with this stream. The general contract of close is that it closes the encoding XDR stream. A closed XDR stream cannot perform encoding operations and cannot be reopened.

The close method of XdrEncodingStream does nothing.

if an ONC/RPC error occurs. if an I/O error occurs.
public Close ( ) : void
return void

beginEncoding() public method

Begins encoding a new XDR record.
Begins encoding a new XDR record. This typically involves resetting this encoding XDR stream back into a known state.
if an ONC/RPC error occurs. if an I/O error occurs.
public beginEncoding ( IPAddress receiverAddress, int receiverPort ) : void
receiverAddress IPAddress /// 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 int Port number of the receiver.
return void

endEncoding() public method

Flushes this encoding XDR stream and forces any buffered output bytes to be written out.
Flushes this encoding XDR stream and forces any buffered output bytes to be written out. The general contract of 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.

The endEncoding method of XdrEncodingStream does nothing.

if an ONC/RPC error occurs. if an I/O error occurs.
public endEncoding ( ) : void
return void

getCharacterEncoding() public method

Get the character encoding for serializing strings.
Get the character encoding for serializing strings.
public getCharacterEncoding ( ) : string
return string

setCharacterEncoding() public method

Set the character encoding for serializing strings.
Set the character encoding for serializing strings.
public setCharacterEncoding ( string characterEncoding ) : void
characterEncoding string /// the encoding to use for serializing strings. /// If null, the system's default encoding is to be used. ///
return void

xdrEncodeBoolean() public method

Encodes (aka "serializes") a boolean and writes it down this XDR stream.
Encodes (aka "serializes") a boolean and writes it down this XDR stream.
if an ONC/RPC error occurs. if an I/O error occurs.
public xdrEncodeBoolean ( bool value ) : void
value bool Boolean value to be encoded.
return void

xdrEncodeBooleanFixedVector() public method

Encodes (aka "serializes") a vector of booleans and writes it down this XDR stream.
Encodes (aka "serializes") a vector of booleans and writes it down this XDR stream.
if an ONC/RPC error occurs. if an I/O error occurs. /// if the length of the vector does not /// match the specified length. ///
public xdrEncodeBooleanFixedVector ( Array value, int length ) : void
value Array long vector to be encoded.
length int /// of vector to write. This parameter is used as a sanity /// check. ///
return void

xdrEncodeBooleanVector() public method

Encodes (aka "serializes") a vector of booleans and writes it down this XDR stream.
Encodes (aka "serializes") a vector of booleans and writes it down this XDR stream.
if an ONC/RPC error occurs. if an I/O error occurs.
public xdrEncodeBooleanVector ( Array value ) : void
value Array long vector to be encoded.
return void

xdrEncodeByte() public method

Encodes (aka "serializes") a byte and write it down this XDR stream.
Encodes (aka "serializes") a byte and write it down this XDR stream.
if an ONC/RPC error occurs. if an I/O error occurs.
public xdrEncodeByte ( byte value ) : void
value byte Byte value to encode.
return void

xdrEncodeByteFixedVector() public method

Encodes (aka "serializes") 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).
Encodes (aka "serializes") 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).
if an ONC/RPC error occurs. if an I/O error occurs. /// if the length of the vector does not /// match the specified length. ///
public xdrEncodeByteFixedVector ( Array value, int length ) : void
value Array Byte vector to encode.
length int /// of vector to write. This parameter is used as a sanity /// check. ///
return void

xdrEncodeByteVector() public method

Encodes (aka "serializes") 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).
Encodes (aka "serializes") 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 vectors are encoded together with a preceeding length value. This way the receiver doesn't need to know the length of the vector in advance.
if an ONC/RPC error occurs. if an I/O error occurs.
public xdrEncodeByteVector ( Array value ) : void
value Array Byte vector to encode.
return void

xdrEncodeDouble() public method

Encodes (aka "serializes") a double (which is a 64 bits wide floating point quantity) and write it down this XDR stream.
Encodes (aka "serializes") a double (which is a 64 bits wide floating point quantity) and write it down this XDR stream.
if an ONC/RPC error occurs. if an I/O error occurs.
public xdrEncodeDouble ( double value ) : void
value double Double value to encode.
return void

xdrEncodeDoubleFixedVector() public method

Encodes (aka "serializes") a vector of doubles and writes it down this XDR stream.
Encodes (aka "serializes") a vector of doubles and writes it down this XDR stream.
if an ONC/RPC error occurs. if an I/O error occurs. /// if the length of the vector does not /// match the specified length. ///
public xdrEncodeDoubleFixedVector ( Array value, int length ) : void
value Array double vector to be encoded.
length int /// of vector to write. This parameter is used as a sanity /// check. ///
return void

xdrEncodeDoubleVector() public method

Encodes (aka "serializes") a vector of doubles and writes it down this XDR stream.
Encodes (aka "serializes") a vector of doubles and writes it down this XDR stream.
if an ONC/RPC error occurs. if an I/O error occurs.
public xdrEncodeDoubleVector ( Array value ) : void
value Array double vector to be encoded.
return void

xdrEncodeDynamicOpaque() public method

Encodes (aka "serializes") a XDR opaque value, which is represented by a vector of byte values.
Encodes (aka "serializes") a XDR opaque value, which is represented by a vector of byte values. The length of the opaque value is written to the XDR stream, so the receiver does not need to know the exact length in advance. The encoded data is always padded to be a multiple of four to maintain XDR alignment.
if an ONC/RPC error occurs. if an I/O error occurs.
public xdrEncodeDynamicOpaque ( Array value ) : void
value Array /// The opaque value to be encoded in the form of a series of /// bytes. ///
return void

xdrEncodeFloat() public method

Encodes (aka "serializes") a float (which is a 32 bits wide floating point quantity) and write it down this XDR stream.
Encodes (aka "serializes") a float (which is a 32 bits wide floating point quantity) and write it down this XDR stream.
if an ONC/RPC error occurs. if an I/O error occurs.
public xdrEncodeFloat ( float value ) : void
value float Float value to encode.
return void

xdrEncodeFloatFixedVector() public method

Encodes (aka "serializes") a vector of floats and writes it down this XDR stream.
Encodes (aka "serializes") a vector of floats and writes it down this XDR stream.
if an ONC/RPC error occurs. if an I/O error occurs. /// if the length of the vector does not /// match the specified length. ///
public xdrEncodeFloatFixedVector ( Array value, int length ) : void
value Array float vector to be encoded.
length int /// of vector to write. This parameter is used as a sanity /// check. ///
return void

xdrEncodeFloatVector() public method

Encodes (aka "serializes") a vector of floats and writes it down this XDR stream.
Encodes (aka "serializes") a vector of floats and writes it down this XDR stream.
if an ONC/RPC error occurs. if an I/O error occurs.
public xdrEncodeFloatVector ( Array value ) : void
value Array float vector to be encoded.
return void

xdrEncodeInt() public abstract method

Encodes (aka "serializes") a "XDR int" value and writes it down a XDR stream.
Encodes (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.
if an ONC/RPC error occurs. if an I/O error occurs.
public abstract xdrEncodeInt ( int value ) : void
value int The int value to be encoded.
return void

xdrEncodeIntFixedVector() public method

Encodes (aka "serializes") a vector of ints and writes it down this XDR stream.
Encodes (aka "serializes") a vector of ints and writes it down this XDR stream.
if an ONC/RPC error occurs. if an I/O error occurs. /// if the length of the vector does not /// match the specified length. ///
public xdrEncodeIntFixedVector ( Array value, int length ) : void
value Array int vector to be encoded.
length int /// of vector to write. This parameter is used as a sanity /// check. ///
return void

xdrEncodeIntVector() public method

Encodes (aka "serializes") a vector of ints and writes it down this XDR stream.
Encodes (aka "serializes") a vector of ints and writes it down this XDR stream.
if an ONC/RPC error occurs. if an I/O error occurs.
public xdrEncodeIntVector ( Array value ) : void
value Array int vector to be encoded.
return void

xdrEncodeLong() public method

Encodes (aka "serializes") a long (which is called a "hyper" in XDR babble and is 64 bits wide) and write it down this XDR stream.
Encodes (aka "serializes") a long (which is called a "hyper" in XDR babble and is 64 bits wide) and write it down this XDR stream.
if an ONC/RPC error occurs. if an I/O error occurs.
public xdrEncodeLong ( long value ) : void
value long Long value to encode.
return void

xdrEncodeLongFixedVector() public method

Encodes (aka "serializes") a vector of long integers and writes it down this XDR stream.
Encodes (aka "serializes") a vector of long integers and writes it down this XDR stream.
if an ONC/RPC error occurs. if an I/O error occurs. /// if the length of the vector does not /// match the specified length. ///
public xdrEncodeLongFixedVector ( Array value, int length ) : void
value Array long vector to be encoded.
length int /// of vector to write. This parameter is used as a sanity /// check. ///
return void

xdrEncodeLongVector() public method

Encodes (aka "serializes") a vector of long integers and writes it down this XDR stream.
Encodes (aka "serializes") a vector of long integers and writes it down this XDR stream.
if an ONC/RPC error occurs. if an I/O error occurs.
public xdrEncodeLongVector ( Array value ) : void
value Array long vector to be encoded.
return void

xdrEncodeOpaque() public method

Encodes (aka "serializes") a XDR opaque value, which is represented by a vector of byte values.
Encodes (aka "serializes") a XDR opaque value, which is represented by a vector of byte values. 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 length of the given byte vector is not a multiple of four, zero bytes will be used for padding.
if an ONC/RPC error occurs. if an I/O error occurs.
public xdrEncodeOpaque ( Array value ) : void
value Array /// The opaque value to be encoded in the form of a series of /// bytes. ///
return void

xdrEncodeOpaque() public method

Encodes (aka "serializes") a XDR opaque value, which is represented by a vector of byte values.
Encodes (aka "serializes") a XDR opaque value, which is represented by a vector of byte values. 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 length of the given byte vector is not a multiple of four, zero bytes will be used for padding.
if an ONC/RPC error occurs. if an I/O error occurs. /// if the length of the vector does not /// match the specified length. ///
public xdrEncodeOpaque ( Array value, int length ) : void
value Array /// The opaque value to be encoded in the form of a series of /// bytes. ///
length int /// of vector to write. This parameter is used as a sanity /// check. ///
return void

xdrEncodeOpaque() public abstract method

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.
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. 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.

if an ONC/RPC error occurs. if an I/O error occurs.
public abstract xdrEncodeOpaque ( Array value, int offset, int length ) : void
value Array /// The opaque value to be encoded in the form of a series of /// bytes. ///
offset int Start offset in the data.
length int the number of bytes to encode.
return void

xdrEncodeShort() public method

Encodes (aka "serializes") a short (which is a 16 bits wide quantity) and write it down this XDR stream.
Encodes (aka "serializes") a short (which is a 16 bits wide quantity) and write it down this XDR stream.
if an ONC/RPC error occurs. if an I/O error occurs.
public xdrEncodeShort ( short value ) : void
value short Short value to encode.
return void

xdrEncodeShortFixedVector() public method

Encodes (aka "serializes") a vector of short integers and writes it down this XDR stream.
Encodes (aka "serializes") a vector of short integers and writes it down this XDR stream.
if an ONC/RPC error occurs. if an I/O error occurs. /// if the length of the vector does not /// match the specified length. ///
public xdrEncodeShortFixedVector ( Array value, int length ) : void
value Array short vector to be encoded.
length int /// of vector to write. This parameter is used as a sanity /// check. ///
return void

xdrEncodeShortVector() public method

Encodes (aka "serializes") a vector of short integers and writes it down this XDR stream.
Encodes (aka "serializes") a vector of short integers and writes it down this XDR stream.
if an ONC/RPC error occurs. if an I/O error occurs.
public xdrEncodeShortVector ( Array value ) : void
value Array short vector to be encoded.
return void

xdrEncodeString() public method

Encodes (aka "serializes") a string and writes it down this XDR stream.
Encodes (aka "serializes") a string and writes it down this XDR stream.
if an ONC/RPC error occurs. if an I/O error occurs.
public xdrEncodeString ( string value ) : void
value string String value to be encoded.
return void

xdrEncodeStringFixedVector() public method

Encodes (aka "serializes") a vector of strings and writes it down this XDR stream.
Encodes (aka "serializes") a vector of strings and writes it down this XDR stream.
if an ONC/RPC error occurs. if an I/O error occurs. /// if the length of the vector does not /// match the specified length. ///
public xdrEncodeStringFixedVector ( Array value, int length ) : void
value Array String vector to be encoded.
length int /// of vector to write. This parameter is used as a sanity /// check. ///
return void

xdrEncodeStringVector() public method

Encodes (aka "serializes") a vector of strings and writes it down this XDR stream.
Encodes (aka "serializes") a vector of strings and writes it down this XDR stream.
if an ONC/RPC error occurs. if an I/O error occurs.
public xdrEncodeStringVector ( Array value ) : void
value Array String vector to be encoded.
return void