@zeroc/ice
    Preparing search index...

    Class InputStream

    The InputStream class provides methods for decoding Slice encoded data from a stream of bytes.

    Index

    Constructors

    • Constructs input stream that uses the communicator's encoding version 1.1, and the given buffer.

      Parameters

      • communicator: Communicator

        The communicator that provides the encoding version, the logger, and the value factory manager.

      • buffer: Uint8Array

        The buffer containing the encoded data.

      Returns InputStream

    • Constructs an input stream that uses the given encoding version, the given communicator, and the given buffer.

      Parameters

      • communicator: Communicator

        The communicator that provides the logger.

      • encoding: EncodingVersion

        The encoding version.

      • buffer: Uint8Array

        The buffer containing the encoded data.

      Returns InputStream

    Properties

    pos: number

    Gets or sets the stream position

    size: number

    Gets the size of the stream.

    Methods

    • Releases any data retained by encapsulations.

      Returns void

    • Reads the end of an encapsulation.

      Returns void

    • Marks the end of an exception.

      Returns void

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

      Returns void

    • Marks the end of a class instance.

      Returns SlicedData

      A SlicedData object containing the preserved slices for unknown types.

    • Returns the size of the current encapsulation, excluding the encapsulation header.

      Returns number

      The size of the encapsulated data.

    • Returns whether the stream is empty.

      Returns boolean

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

    • Reads and validates a sequence size.

      Parameters

      • minSize: number

        The minimum size of the sequence elements.

      Returns number

      The size read from the stream.

    • Reads a blob of bytes from the stream.

      Parameters

      • sz: number

        The number of bytes to read.

      Returns Uint8Array

      The byte array read from the stream.

    • Reads a boolean from the stream.

      Returns boolean

      The boolean read from the stream.

    • Reads a byte from the stream.

      Returns number

      The byte read from the stream.

    • Reads a byte sequence from the stream.

      Returns Uint8Array

      The byte sequence read from the stream.

    • Reads a double from the stream.

      Returns number

      The double read from the stream.

    • Reads and encapsulation from the stream.

      Returns [EncodingVersion, Uint8Array<ArrayBufferLike>]

      a tuple containing:

      • The encoding version of the encapsulation.
      • The encapsulation data.
    • Reads an enumerated value.

      Type Parameters

      Parameters

      • type: new (name: string, value: number) => T

        The type of the enumeration.

      Returns T

      The enumerated value.

    • Reads a float from the stream.

      Returns number

      The float read from the stream.

    • Reads an integer from the stream.

      Returns number

      The integer read from the stream.

    • Reads a long from the stream.

      Returns bigint

      The long read from the stream.

    • Determine if an optional value is available for reading.

      Parameters

      • tag: number

        The tag associated with the value.

      • expectedFormat: OptionalFormat

        The optional format for the value.

      Returns boolean

      True if the optional value is present, false otherwise.

    • Reads an enumerated value.

      Type Parameters

      • T

      Parameters

      • tag: number

        The numeric tag associated with the value.

      • type: new () => T

        The type of the enumeration.

      Returns T

      The enumerated value or undefined if the optional value is not present.

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

      Type Parameters

      Parameters

      • tag: number

        The numeric tag associated with the value.

      • type: new () => T

        The type of the proxy to read.

      Returns T

      The proxy or undefined if the optional value is not present.

      Ice.MarshalException If the stream has not been initialized with a communicator and cannot be used for unmarshaling proxies.

    • Indicates that unmarshaling is complete, except for any class instances. The application must call this method only if the stream actually contains class instances.

      Returns void

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

      Type Parameters

      Parameters

      • type: new () => T

        the type of the proxy to read.

      Returns T

      The proxy.

      Ice.MarshalException If the stream has not been initialized with a communicator and cannot be used for unmarshaling proxies.

    • Reads a short from the stream.

      Returns number

      The short read from the stream.

    • Reads a size from the stream.

      Returns number

      The size read from the stream.

    • Reads a string from the stream.

      Returns string

      The string read from the stream.

    • Reads the index of a Slice value from the stream.

      Type Parameters

      Parameters

      • cb: (value: T) => void

        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 callback when the corresponding instance has been fully unmarshaled.

      • type: new () => T

      Returns void

    • Resizes the stream to a new size.

      Parameters

      • sz: number

        The new size.

      Returns void

    • Skip the given number of bytes.

      Parameters

      • size: number

        The number of bytes to skip.

      Returns void

    • Skip over a size value.

      Returns void

    • Skips over a class instance or exception slice.

      Returns void

    • Marks the start of an exception.

      Returns void

    • Reads the start of a class instance or exception slice.

      Returns string

      The Slice type ID for this slice.

    • Marks the start of a class instance.

      Returns void

    • Swaps the contents of one stream with another.

      Parameters

      Returns void

    • Reads a user exception from the stream and throws it.

      Returns void