C# Класс 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.

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
StrToByteArray ( string str ) : byte[]
StrToByteArray ( string str, Encoding encoding ) : byte[]

Описание методов

Close() публичный Метод

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
Результат void

beginEncoding() публичный Метод

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.
Результат void

endEncoding() публичный Метод

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
Результат void

getCharacterEncoding() публичный Метод

Get the character encoding for serializing strings.
Get the character encoding for serializing strings.
public getCharacterEncoding ( ) : string
Результат string

setCharacterEncoding() публичный Метод

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. ///
Результат void

xdrEncodeBoolean() публичный Метод

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.
Результат void

xdrEncodeBooleanFixedVector() публичный Метод

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. ///
Результат void

xdrEncodeBooleanVector() публичный Метод

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.
Результат void

xdrEncodeByte() публичный Метод

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.
Результат void

xdrEncodeByteFixedVector() публичный Метод

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. ///
Результат void

xdrEncodeByteVector() публичный Метод

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.
Результат void

xdrEncodeDouble() публичный Метод

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.
Результат void

xdrEncodeDoubleFixedVector() публичный Метод

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. ///
Результат void

xdrEncodeDoubleVector() публичный Метод

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.
Результат void

xdrEncodeDynamicOpaque() публичный Метод

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. ///
Результат void

xdrEncodeFloat() публичный Метод

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.
Результат void

xdrEncodeFloatFixedVector() публичный Метод

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. ///
Результат void

xdrEncodeFloatVector() публичный Метод

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.
Результат void

xdrEncodeInt() публичный абстрактный Метод

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.
Результат void

xdrEncodeIntFixedVector() публичный Метод

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. ///
Результат void

xdrEncodeIntVector() публичный Метод

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.
Результат void

xdrEncodeLong() публичный Метод

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.
Результат void

xdrEncodeLongFixedVector() публичный Метод

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. ///
Результат void

xdrEncodeLongVector() публичный Метод

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.
Результат void

xdrEncodeOpaque() публичный Метод

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. ///
Результат void

xdrEncodeOpaque() публичный Метод

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. ///
Результат void

xdrEncodeOpaque() публичный абстрактный Метод

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.
Результат void

xdrEncodeShort() публичный Метод

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.
Результат void

xdrEncodeShortFixedVector() публичный Метод

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. ///
Результат void

xdrEncodeShortVector() публичный Метод

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.
Результат void

xdrEncodeString() публичный Метод

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.
Результат void

xdrEncodeStringFixedVector() публичный Метод

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. ///
Результат void

xdrEncodeStringVector() публичный Метод

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.
Результат void