@zeroc/ice
    Preparing search index...

    Class OutputStream

    The OutputStream class provides methods for encoding data using Slice encoding into a stream of bytes.

    Index

    Constructors

    • Constructs an empty output stream that uses the communicator's default encoding version and compact class format.

      Parameters

      • communicator: Communicator

        The communicator that provides the encoding version and class format.

      Returns OutputStream

    • Constructs an empty output stream.

      Parameters

      • Optionalencoding: EncodingVersion

        The encoding version. null is equivalent to encoding 1.1.

      • Optionalformat: FormatType

        The class format. null is equivalent to FormatType.CompactFormat.

      Returns OutputStream

    Properties

    buffer: Uint8Array

    Gets the buffer containing the stream data.

    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 previous 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 the marshaling of a request or reply is finished.

      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.

    • Prepares the internal buffer for writing to a socket.

      Returns Uint8Array

      The Uint8Array containing the encoded request or reply.

    • 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 to the stream.

      Returns void

    • Writes the end of an encapsulation to the stream.

      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

        Preserved slices for this instance, or null.

      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

        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 void

    • 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

    • Writes the state of Slice classes whose index was previously written with writeValue() to the stream.

      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

        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. This method writes the index of an instance; the state of the value is written once OutputStream.writePendingValues is called.

      Parameters

      • v: Value

        The value to write.

      Returns void