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
communicatorCommunicatorThe communicator to use when unmarshaling classes, exceptions and proxies.
encodingEncodingVersionThe desired encoding version.
databyte[]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
communicatorCommunicatorThe communicator to use when unmarshaling classes, exceptions and proxies.
databyte[]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
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
nintThe new position.
readAndCheckSeqSize(int)
Reads and validates a sequence size.
public int readAndCheckSeqSize(int minSize)
Parameters
minSizeintThe 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
vbyte[]Bytes from the stream.
readBlob(int)
Reads a blob of bytes from the stream.
public byte[] readBlob(int sz)
Parameters
szintThe 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
tagintThe 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
lLinkedList<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
readBoolSeq(out Queue<bool>)
Extracts a sequence of boolean values from the stream.
public void readBoolSeq(out Queue<bool> l)
Parameters
readBoolSeq(out Stack<bool>)
Extracts a sequence of boolean values from the stream.
public void readBoolSeq(out Stack<bool> l)
Parameters
readBoolSeq(int)
Extracts an optional boolean sequence from the stream.
public bool[]? readBoolSeq(int tag)
Parameters
tagintThe 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
tagintThe 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
lLinkedList<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
readByteSeq(out Queue<byte>)
Extracts a sequence of byte values from the stream.
public void readByteSeq(out Queue<byte> l)
Parameters
readByteSeq(out Stack<byte>)
Extracts a sequence of byte values from the stream.
public void readByteSeq(out Stack<byte> l)
Parameters
readByteSeq(int)
Extracts an optional byte sequence from the stream.
public byte[]? readByteSeq(int tag)
Parameters
tagintThe 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
tagintThe 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
lLinkedList<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
readDoubleSeq(out Queue<double>)
Extracts a sequence of double values from the stream.
public void readDoubleSeq(out Queue<double> l)
Parameters
readDoubleSeq(out Stack<double>)
Extracts a sequence of double values from the stream.
public void readDoubleSeq(out Stack<double> l)
Parameters
readDoubleSeq(int)
Extracts an optional double sequence from the stream.
public double[]? readDoubleSeq(int tag)
Parameters
tagintThe 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
encodingEncodingVersionThe encapsulation's encoding version.
Returns
- byte[]
The encoded encapsulation.
readEnum(int)
Read an enumerated value.
public int readEnum(int maxValue)
Parameters
maxValueintThe 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
tagintThe 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
lLinkedList<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
readFloatSeq(out Queue<float>)
Extracts a sequence of float values from the stream.
public void readFloatSeq(out Queue<float> l)
Parameters
readFloatSeq(out Stack<float>)
Extracts a sequence of float values from the stream.
public void readFloatSeq(out Stack<float> l)
Parameters
readFloatSeq(int)
Extracts an optional float sequence from the stream.
public float[]? readFloatSeq(int tag)
Parameters
tagintThe 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
tagintThe 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
lLinkedList<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
readIntSeq(out Queue<int>)
Extracts a sequence of int values from the stream.
public void readIntSeq(out Queue<int> l)
Parameters
readIntSeq(out Stack<int>)
Extracts a sequence of int values from the stream.
public void readIntSeq(out Stack<int> l)
Parameters
readIntSeq(int)
Extracts an optional int sequence from the stream.
public int[]? readIntSeq(int tag)
Parameters
tagintThe 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
tagintThe 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
lLinkedList<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
readLongSeq(out Queue<long>)
Extracts a sequence of long values from the stream.
public void readLongSeq(out Queue<long> l)
Parameters
readLongSeq(out Stack<long>)
Extracts a sequence of long values from the stream.
public void readLongSeq(out Stack<long> l)
Parameters
readLongSeq(int)
Extracts an optional long sequence from the stream.
public long[]? readLongSeq(int tag)
Parameters
tagintThe 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
tagintThe tag associated with the value.
expectedFormatOptionalFormatThe optional format for the value.
Returns
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
tagintThe 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
tagintThe 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
lLinkedList<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
readShortSeq(out Queue<short>)
Extracts a sequence of short values from the stream.
public void readShortSeq(out Queue<short> l)
Parameters
readShortSeq(out Stack<short>)
Extracts a sequence of short values from the stream.
public void readShortSeq(out Stack<short> l)
Parameters
readShortSeq(int)
Extracts an optional short sequence from the stream.
public short[]? readShortSeq(int tag)
Parameters
tagintThe 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
tagintThe 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
lLinkedList<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
readStringSeq(out Queue<string>)
Extracts a sequence of strings from the stream.
public void readStringSeq(out Queue<string> l)
Parameters
readStringSeq(out Stack<string>)
Extracts a sequence of strings from the stream.
public void readStringSeq(out Stack<string> l)
Parameters
readStringSeq(int)
Extracts an optional string sequence from the stream.
public string[]? readStringSeq(int tag)
Parameters
tagintThe 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
cbAction<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
cbAction<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
TThe 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
sizeintThe 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
otherInputStreamThe other stream.
throwException()
Extracts a user exception from the stream and throws it.
public void throwException()