@zeroc/ice
    Preparing search index...

    Class OutputStream

    Represents a byte buffer used for marshaling data using the Slice encoding.

    Index

    Constructors

    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

    • Ends the current encapsulation.

      Returns void

    • Marks the end of an exception.

      Returns void

    • Computes the amount of data written since the previous call to startSize and writes that value at the saved position.

      Parameters

      • pos: number

        The saved position.

      Returns void

    • Marks the end of a slice for a class instance or user exception.

      Returns void

    • Marks the end of a class instance.

      Returns void

    • Expand the stream to accept more data.

      Parameters

      • n: number

        The number of bytes to accommodate in the stream.

      Returns void

    • Indicates that marshaling is complete.

      Returns Uint8Array

      The Uint8Array containing the encoded request or reply

    • Returns whether the stream is empty.

      Returns boolean

      True if no data has been written yet, false otherwise.

    • Resizes the stream to a new size.

      Parameters

      • sz: number

        The new size of the stream in bytes.

      Returns void

    • Writes the start of an encapsulation. A nested encapsulation uses the encoding version and class format of the enclosing encapsulation; a top-level encapsulation uses the stream's encoding version and class format.

      Returns void

    • Writes the start of an encapsulation using the specified encoding version and class format.

      Parameters

      • encoding: EncodingVersion

        The encoding version of the encapsulation.

      • Optionalformat: FormatType

        The class format of the encapsulation. If not specified, the OutputStream's class format is used.

      Returns void

    • Marks the start of an exception.

      Returns void

    • Returns the current position and allocates four bytes for a fixed-length (32-bit) size value.

      Returns number

      The current position.

    • Marks the start of a new slice for a class instance or user exception.

      Parameters

      • typeId: string

        The Slice type ID corresponding to this slice.

      • compactId: number

        The Slice compact type ID corresponding to this slice or -1 if no compact ID is defined for the type ID.

      • last: boolean

        True if this is the last slice, false otherwise.

      Returns void

    • Marks the start of a class instance.

      Parameters

      • slicedData: SlicedData | null

        Preserved slices for this instance, or null. These slices are marshaled with the instance only when this stream uses the sliced format; otherwise they are ignored.

      Returns void

    • Swaps the contents of this stream with another.

      Parameters

      Returns void

    • Writes a blob of bytes to the stream.

      Parameters

      • v: Uint8Array

        The blob of bytes to write.

      Returns void

    • Writes a boolean to the stream.

      Parameters

      • v: boolean

        The boolean to write to the stream.

      Returns void

    • Writes a byte to the stream.

      Parameters

      • v: number

        The byte to write to the stream.

      Returns void

    • Writes a byte sequence to the stream.

      Parameters

      • Optionalv: Uint8Array<ArrayBufferLike>

        The byte sequence to write to the stream. Passing null causes an empty sequence to be written to the stream.

      Returns void

    • Writes a double to the stream.

      Parameters

      • v: number

        The double to write to the stream.

      Returns void

    • Writes an empty encapsulation using the given encoding version.

      Parameters

      Returns void

    • Writes a pre-encoded encapsulation to the stream.

      Parameters

      • buff: Uint8Array

        The encapsulation data.

      Returns void

    • Writes an enumerated value.

      Parameters

      • v: EnumBase

        The enumerator to write to the stream.

      Returns void

    • Writes a user exception to the stream.

      Parameters

      Returns void

    • Writes a float to the stream.

      Parameters

      • v: number

        The float to write to the stream.

      Returns void

    • Writes an integer to the stream.

      Parameters

      • v: number

        The integer to write to the stream.

      Returns void

    • Writes a long to the stream.

      Parameters

      • v: number | bigint

        The long to write to the stream.

      Returns void

    • Write the header information for an optional value.

      Parameters

      • tag: number

        The numeric tag associated with the value.

      • format: OptionalFormat

        The optional format of the value.

      Returns boolean

      true if the current encoding version supports optional values, false otherwise. If true, the data associated with the optional value must be written next.

    • Writes an optional proxy to the stream.

      Parameters

      • tag: number

        The optional tag.

      • Optionalv: ObjectPrx

        The proxy to write, or undefined if the optional proxy is not present.

      Returns void

    • Encodes the state of class instances whose insertion was delayed during a previous call to OutputStream#writeValue. This function must be called only once. For backward compatibility with encoding version 1.0, this function must be called only when non-optional fields or parameters use class types.

      Returns void

    • Writes a proxy to the stream.

      Parameters

      Returns void

    • Writes a short to the stream.

      Parameters

      • v: number

        The short to write to the stream.

      Returns void

    • Writes a size to the stream.

      Parameters

      • v: number

        The size to write.

      Returns void

    • Writes a string to the stream.

      Parameters

      • v: string | null

        The string to write to the stream. Passing null causes an empty string to be written to the stream.

      Returns void

    • Writes a class instance to the stream.

      Parameters

      Returns void