Table of Contents

Class InputStream

Namespace
Ice
Assembly
Ice.dll

Interface for input streams used to extract Slice types from a sequence of bytes.

public sealed class InputStream
Inheritance
InputStream
Inherited Members

Constructors

InputStream(Communicator, EncodingVersion, byte[])

Initializes a new instance of the InputStream class.

public InputStream(Communicator communicator, EncodingVersion encoding, byte[] data)

Parameters

communicator Communicator

The communicator to use when unmarshaling classes, exceptions and proxies.

encoding EncodingVersion

The desired encoding version.

data byte[]

The byte array containing encoded Slice types.

InputStream(Communicator, byte[])

Initializes a new instance of the InputStream class. This constructor uses the communicator's default encoding version.

public InputStream(Communicator communicator, byte[] data)

Parameters

communicator Communicator

The communicator to use when unmarshaling classes, exceptions and proxies.

data byte[]

The byte array containing encoded Slice types.

Methods

clear()

Releases any data retained by encapsulations. Internally calls clear().

public void clear()

endEncapsulation()

Ends the previous encapsulation.

public void endEncapsulation()

endException()

Marks the end of a user exception.

public void endException()

endSlice()

Indicates that the end of a class instance or exception slice has been reached.

public void endSlice()

endValue()

Marks the end of a class instance.

public SlicedData? endValue()

Returns

SlicedData

A SlicedData object containing the preserved slices for unknown types.

getEncapsulationSize()

Determines the size of the current encapsulation, excluding the encapsulation header.

public int getEncapsulationSize()

Returns

int

The size of the encapsulated data.

getEncoding()

Determines the current encoding version.

public EncodingVersion getEncoding()

Returns

EncodingVersion

The encoding version.

isEmpty()

Determines whether the stream is empty.

public bool isEmpty()

Returns

bool

true if the internal buffer has no data, false otherwise.

pos()

Determines the current position in the stream.

public int pos()

Returns

int

The current position.

pos(int)

Sets the current position in the stream.

public void pos(int n)

Parameters

n int

The new position.

readAndCheckSeqSize(int)

Reads and validates a sequence size.

public int readAndCheckSeqSize(int minSize)

Parameters

minSize int

The minimum size required to encode a sequence element.

Returns

int

The extracted size.

readBlob(byte[])

Reads a blob of bytes from the stream. The length of the given array determines how many bytes are read.

public void readBlob(byte[] v)

Parameters

v byte[]

Bytes from the stream.

readBlob(int)

Reads a blob of bytes from the stream.

public byte[] readBlob(int sz)

Parameters

sz int

The number of bytes to read.

Returns

byte[]

The requested bytes as a byte array.

readBool()

Extracts a boolean value from the stream.

public bool readBool()

Returns

bool

The extracted boolean.

readBool(int)

Extracts an optional boolean value from the stream.

public bool? readBool(int tag)

Parameters

tag int

The numeric tag associated with the value.

Returns

bool?

The optional value.

readBoolSeq()

Extracts a sequence of boolean values from the stream.

public bool[] readBoolSeq()

Returns

bool[]

The extracted boolean sequence.

readBoolSeq(out LinkedList<bool>)

Extracts a sequence of boolean values from the stream.

public void readBoolSeq(out LinkedList<bool> l)

Parameters

l LinkedList<bool>

The extracted boolean sequence as a linked list.

readBoolSeq(out List<bool>)

Extracts a sequence of boolean values from the stream.

public void readBoolSeq(out List<bool> l)

Parameters

l List<bool>

The extracted boolean sequence as a list.

readBoolSeq(out Queue<bool>)

Extracts a sequence of boolean values from the stream.

public void readBoolSeq(out Queue<bool> l)

Parameters

l Queue<bool>

The extracted boolean sequence as a queue.

readBoolSeq(out Stack<bool>)

Extracts a sequence of boolean values from the stream.

public void readBoolSeq(out Stack<bool> l)

Parameters

l Stack<bool>

The extracted boolean sequence as a stack.

readBoolSeq(int)

Extracts an optional boolean sequence from the stream.

public bool[]? readBoolSeq(int tag)

Parameters

tag int

The numeric tag associated with the value.

Returns

bool[]

The optional value.

readByte()

Extracts a byte value from the stream.

public byte readByte()

Returns

byte

The extracted byte.

readByte(int)

Extracts an optional byte value from the stream.

public byte? readByte(int tag)

Parameters

tag int

The numeric tag associated with the value.

Returns

byte?

The optional value.

readByteSeq()

Extracts a sequence of byte values from the stream.

public byte[] readByteSeq()

Returns

byte[]

The extracted byte sequence.

readByteSeq(out LinkedList<byte>)

Extracts a sequence of byte values from the stream.

public void readByteSeq(out LinkedList<byte> l)

Parameters

l LinkedList<byte>

The extracted byte sequence as a linked list.

readByteSeq(out List<byte>)

Extracts a sequence of byte values from the stream.

public void readByteSeq(out List<byte> l)

Parameters

l List<byte>

The extracted byte sequence as a list.

readByteSeq(out Queue<byte>)

Extracts a sequence of byte values from the stream.

public void readByteSeq(out Queue<byte> l)

Parameters

l Queue<byte>

The extracted byte sequence as a queue.

readByteSeq(out Stack<byte>)

Extracts a sequence of byte values from the stream.

public void readByteSeq(out Stack<byte> l)

Parameters

l Stack<byte>

The extracted byte sequence as a stack.

readByteSeq(int)

Extracts an optional byte sequence from the stream.

public byte[]? readByteSeq(int tag)

Parameters

tag int

The numeric tag associated with the value.

Returns

byte[]

The optional value.

readDouble()

Extracts a double value from the stream.

public double readDouble()

Returns

double

The extracted double.

readDouble(int)

Extracts an optional double value from the stream.

public double? readDouble(int tag)

Parameters

tag int

The numeric tag associated with the value.

Returns

double?

The optional value.

readDoubleSeq()

Extracts a sequence of double values from the stream.

public double[] readDoubleSeq()

Returns

double[]

The extracted double sequence.

readDoubleSeq(out LinkedList<double>)

Extracts a sequence of double values from the stream.

public void readDoubleSeq(out LinkedList<double> l)

Parameters

l LinkedList<double>

The extracted double sequence as a linked list.

readDoubleSeq(out List<double>)

Extracts a sequence of double values from the stream.

public void readDoubleSeq(out List<double> l)

Parameters

l List<double>

The extracted double sequence as a list.

readDoubleSeq(out Queue<double>)

Extracts a sequence of double values from the stream.

public void readDoubleSeq(out Queue<double> l)

Parameters

l Queue<double>

The extracted double sequence as a queue.

readDoubleSeq(out Stack<double>)

Extracts a sequence of double values from the stream.

public void readDoubleSeq(out Stack<double> l)

Parameters

l Stack<double>

The extracted double sequence as a stack.

readDoubleSeq(int)

Extracts an optional double sequence from the stream.

public double[]? readDoubleSeq(int tag)

Parameters

tag int

The numeric tag associated with the value.

Returns

double[]

The optional value.

readEncapsulation(out EncodingVersion)

Returns a blob of bytes representing an encapsulation. The encapsulation's encoding version is returned in the argument.

public byte[] readEncapsulation(out EncodingVersion encoding)

Parameters

encoding EncodingVersion

The encapsulation's encoding version.

Returns

byte[]

The encoded encapsulation.

readEnum(int)

Read an enumerated value.

public int readEnum(int maxValue)

Parameters

maxValue int

The maximum enumerator value in the definition.

Returns

int

The enumerator.

readFloat()

Extracts a float value from the stream.

public float readFloat()

Returns

float

The extracted float.

readFloat(int)

Extracts an optional float value from the stream.

public float? readFloat(int tag)

Parameters

tag int

The numeric tag associated with the value.

Returns

float?

The optional value.

readFloatSeq()

Extracts a sequence of float values from the stream.

public float[] readFloatSeq()

Returns

float[]

The extracted float sequence.

readFloatSeq(out LinkedList<float>)

Extracts a sequence of float values from the stream.

public void readFloatSeq(out LinkedList<float> l)

Parameters

l LinkedList<float>

The extracted float sequence as a linked list.

readFloatSeq(out List<float>)

Extracts a sequence of float values from the stream.

public void readFloatSeq(out List<float> l)

Parameters

l List<float>

The extracted float sequence as a list.

readFloatSeq(out Queue<float>)

Extracts a sequence of float values from the stream.

public void readFloatSeq(out Queue<float> l)

Parameters

l Queue<float>

The extracted float sequence as a queue.

readFloatSeq(out Stack<float>)

Extracts a sequence of float values from the stream.

public void readFloatSeq(out Stack<float> l)

Parameters

l Stack<float>

The extracted float sequence as a stack.

readFloatSeq(int)

Extracts an optional float sequence from the stream.

public float[]? readFloatSeq(int tag)

Parameters

tag int

The numeric tag associated with the value.

Returns

float[]

The optional value.

readInt()

Extracts an int value from the stream.

public int readInt()

Returns

int

The extracted int.

readInt(int)

Extracts an optional int value from the stream.

public int? readInt(int tag)

Parameters

tag int

The numeric tag associated with the value.

Returns

int?

The optional value.

readIntSeq()

Extracts a sequence of int values from the stream.

public int[] readIntSeq()

Returns

int[]

The extracted int sequence.

readIntSeq(out LinkedList<int>)

Extracts a sequence of int values from the stream.

public void readIntSeq(out LinkedList<int> l)

Parameters

l LinkedList<int>

The extracted int sequence as a linked list.

readIntSeq(out List<int>)

Extracts a sequence of int values from the stream.

public void readIntSeq(out List<int> l)

Parameters

l List<int>

The extracted int sequence as a list.

readIntSeq(out Queue<int>)

Extracts a sequence of int values from the stream.

public void readIntSeq(out Queue<int> l)

Parameters

l Queue<int>

The extracted int sequence as a queue.

readIntSeq(out Stack<int>)

Extracts a sequence of int values from the stream.

public void readIntSeq(out Stack<int> l)

Parameters

l Stack<int>

The extracted int sequence as a stack.

readIntSeq(int)

Extracts an optional int sequence from the stream.

public int[]? readIntSeq(int tag)

Parameters

tag int

The numeric tag associated with the value.

Returns

int[]

The optional value.

readLong()

Extracts a long value from the stream.

public long readLong()

Returns

long

The extracted long.

readLong(int)

Extracts an optional long value from the stream.

public long? readLong(int tag)

Parameters

tag int

The numeric tag associated with the value.

Returns

long?

The optional value.

readLongSeq()

Extracts a sequence of long values from the stream.

public long[] readLongSeq()

Returns

long[]

The extracted long sequence.

readLongSeq(out LinkedList<long>)

Extracts a sequence of long values from the stream.

public void readLongSeq(out LinkedList<long> l)

Parameters

l LinkedList<long>

The extracted long sequence as a linked list.

readLongSeq(out List<long>)

Extracts a sequence of long values from the stream.

public void readLongSeq(out List<long> l)

Parameters

l List<long>

The extracted long sequence as a list.

readLongSeq(out Queue<long>)

Extracts a sequence of long values from the stream.

public void readLongSeq(out Queue<long> l)

Parameters

l Queue<long>

The extracted long sequence as a queue.

readLongSeq(out Stack<long>)

Extracts a sequence of long values from the stream.

public void readLongSeq(out Stack<long> l)

Parameters

l Stack<long>

The extracted long sequence as a stack.

readLongSeq(int)

Extracts an optional long sequence from the stream.

public long[]? readLongSeq(int tag)

Parameters

tag int

The numeric tag associated with the value.

Returns

long[]

The optional value.

readOptional(int, OptionalFormat)

Determine if an optional value is available for reading.

public bool readOptional(int tag, OptionalFormat expectedFormat)

Parameters

tag int

The tag associated with the value.

expectedFormat OptionalFormat

The optional format for the value.

Returns

bool

true if the value is present, false otherwise.

readPendingValues()

Indicates that unmarshaling is complete, except for any class instances. The application must call this method only if the stream actually contains class instances. Calling readPendingValues triggers the calls to the System.Action delegates to inform the application that unmarshaling of an instance is complete.

public void readPendingValues()

readProxy()

Extracts a proxy from the stream. The stream must have been initialized with a communicator.

public ObjectPrx? readProxy()

Returns

ObjectPrx

The extracted proxy.

readProxy(int)

Extracts an optional proxy from the stream. The stream must have been initialized with a communicator.

public ObjectPrx? readProxy(int tag)

Parameters

tag int

The numeric tag associated with the value.

Returns

ObjectPrx

The optional value.

Remarks

This method is not used by the generated code.

readShort()

Extracts a short value from the stream.

public short readShort()

Returns

short

The extracted short.

readShort(int)

Extracts an optional short value from the stream.

public short? readShort(int tag)

Parameters

tag int

The numeric tag associated with the value.

Returns

short?

The optional value.

readShortSeq()

Extracts a sequence of short values from the stream.

public short[] readShortSeq()

Returns

short[]

The extracted short sequence.

readShortSeq(out LinkedList<short>)

Extracts a sequence of short values from the stream.

public void readShortSeq(out LinkedList<short> l)

Parameters

l LinkedList<short>

The extracted short sequence as a linked list.

readShortSeq(out List<short>)

Extracts a sequence of short values from the stream.

public void readShortSeq(out List<short> l)

Parameters

l List<short>

The extracted short sequence as a list.

readShortSeq(out Queue<short>)

Extracts a sequence of short values from the stream.

public void readShortSeq(out Queue<short> l)

Parameters

l Queue<short>

The extracted short sequence as a queue.

readShortSeq(out Stack<short>)

Extracts a sequence of short values from the stream.

public void readShortSeq(out Stack<short> l)

Parameters

l Stack<short>

The extracted short sequence as a stack.

readShortSeq(int)

Extracts an optional short sequence from the stream.

public short[]? readShortSeq(int tag)

Parameters

tag int

The numeric tag associated with the value.

Returns

short[]

The optional value.

readSize()

Extracts a size from the stream.

public int readSize()

Returns

int

The extracted size.

readString()

Extracts a string from the stream.

public string readString()

Returns

string

The extracted string.

readString(int)

Extracts an optional string from the stream.

public string? readString(int tag)

Parameters

tag int

The numeric tag associated with the value.

Returns

string

The optional value.

readStringSeq()

Extracts a sequence of strings from the stream.

public string[] readStringSeq()

Returns

string[]

The extracted string sequence.

readStringSeq(out LinkedList<string>)

Extracts a sequence of strings from the stream.

public void readStringSeq(out LinkedList<string> l)

Parameters

l LinkedList<string>

The extracted string sequence as a linked list.

readStringSeq(out List<string>)

Extracts a sequence of strings from the stream.

public void readStringSeq(out List<string> l)

Parameters

l List<string>

The extracted string sequence as a list.

readStringSeq(out Queue<string>)

Extracts a sequence of strings from the stream.

public void readStringSeq(out Queue<string> l)

Parameters

l Queue<string>

The extracted string sequence as a queue.

readStringSeq(out Stack<string>)

Extracts a sequence of strings from the stream.

public void readStringSeq(out Stack<string> l)

Parameters

l Stack<string>

The extracted string sequence as a stack.

readStringSeq(int)

Extracts an optional string sequence from the stream.

public string[]? readStringSeq(int tag)

Parameters

tag int

The numeric tag associated with the value.

Returns

string[]

The optional value.

readValue(Action<Value?>)

Extracts the index of a Slice value from the stream.

public void readValue(Action<Value?> cb)

Parameters

cb Action<Value>

The callback to notify the application when the extracted instance is available. The stream extracts Slice values in stages. The Ice run time invokes the delegate when the corresponding instance has been fully unmarshaled.

readValue<T>(Action<T?>)

Extracts the index of a Slice value from the stream.

public void readValue<T>(Action<T?> cb) where T : Value

Parameters

cb Action<T>

The callback to notify the application when the extracted instance is available. The stream extracts Slice values in stages. The Ice run time invokes the delegate when the corresponding instance has been fully unmarshaled.

Type Parameters

T

The type of the Slice value to extract.

reset()

Resets this stream. This method allows the stream to be reused, to avoid creating unnecessary garbage.

public void reset()

size()

Determines the current size of the stream.

public int size()

Returns

int

The current size.

skip(int)

Skip the given number of bytes.

public void skip(int size)

Parameters

size int

The number of bytes to skip.

skipEmptyEncapsulation()

Skips an empty encapsulation.

public EncodingVersion skipEmptyEncapsulation()

Returns

EncodingVersion

The encapsulation's encoding version.

skipEncapsulation()

Skips over an encapsulation.

public EncodingVersion skipEncapsulation()

Returns

EncodingVersion

The encoding version of the skipped encapsulation.

skipSize()

Skip over a size value.

public void skipSize()

skipSlice()

Skips over a class instance or exception slice.

public void skipSlice()

startEncapsulation()

Reads the start of an encapsulation.

public EncodingVersion startEncapsulation()

Returns

EncodingVersion

The encapsulation encoding version.

startException()

Marks the start of a user exception.

public void startException()

startSlice()

Reads the start of a class instance or exception slice.

public void startSlice()

startValue()

Marks the start of a class instance.

public void startValue()

swap(InputStream)

Swaps the contents of one stream with another.

public void swap(InputStream other)

Parameters

other InputStream

The other stream.

throwException()

Extracts a user exception from the stream and throws it.

public void throwException()