An InputStream is created using the following function:

{zcode:cs}
namespace Ice
{
    public sealed class Util
    {
        public static InputStream createInputStream(
            Communicator communicator,
            byte[] bytes);
    }
}
{zcode}

The InputStream interface is shown below.

{zcode:cs}
namespace Ice
{
    public interface InputStream
    {
        Communicator communicator();

        void sliceObjects(bool slice);

        bool readBool();
        bool[] readBoolSeq();

        byte readByte();
        byte[] readByteSeq();

        short readShort();
        short[] readShortSeq();

        int readInt();
        int[] readIntSeq();

        long readLong();
        long[] readLongSeq();

        float readFloat();
        float[] readFloatSeq();

        double readDouble();
        double[] readDoubleSeq();

        string readString();
        string[] readStringSeq();

        int readSize();
        int readAndCheckSeqSize(int minSize);

        ObjectPrx readProxy();

        void readObject(ReadObjectCallback cb);

        string readTypeId();

        void throwException();

        void startSlice();
        void endSlice();
        void skipSlice();

        void startEncapsulation();
        void endEncapsulation();
        void skipEncapsulation();
        int getEncapsulationSize();

        void readPendingObjects();

        object readSerializable();

        void rewind();

        void destroy();
    }
}
{zcode}

Member functions are provided for extracting all of the primitive types, as well as sequences of primitive types; these are self-explanatory. The remaining member functions have the following semantics:

Here is a simple example that demonstrates how to extract a boolean and a sequence of strings from a stream:

{zcode:cs}
byte[] data = ...
Ice.InputStream inStream =
    Ice.Util.createInputStream(communicator, data);
try {
    bool b = inStream.readBool();
    string[] seq = inStream.readStringSeq();
} finally {
    inStream.destroy();
}
{zcode}
See Also