On this page:

Initializing an InputStream in JavaScript

The InputStream class provides a constructor that accepts up to three arguments. Legal argument values are:

You'll normally supply the encoded data argument. The stream does not make a copy of this data; rather, it uses the data as supplied and assumes it remains unmodified for the lifetime of the stream object.

We recommend supplying a communicator instance, otherwise you will not be able to decode proxy objects. The stream also inspects the communicator's settings to configure several of its own default settings, but you can optionally configure these settings manually using methods that we'll describe later.

If you omit an encoding version, the stream uses the default encoding version of the communicator (if provided) or the most recent encoding version.

Use the following properties to manually configure the stream:

var stream = new Ice.InputStream(...);
stream.valueFactoryManager = ...
stream.logger = ...
stream.compactIdResolver = ...
stream.sliceValues = ...
stream.traceSlicing = ...

The settings include:

Extracting from an InputStream in JavaScript

InputStream provides a number of read methods that allow you to extract Slice types from the stream.

For example, you can extract a boolean and a string from a stream as follows:

var data = ...
var istr = new Ice.InputStream(communicator, data);
var b = istr.readBool();
var s = istr.readString();

Here are the methods for extracting data from a stream:

Finally, you can use the pos property to get and set the stream's current position.

See Also