mimekit-ts - v1.0.0
    Preparing search index...

    Class MemoryStream

    Substrate shim for System.IO.MemoryStream: a growable, seekable in-memory stream used pervasively by tests and by ported code that buffers content.

    Hierarchy (View Summary)

    Index
    • get canRead(): boolean

      Whether the stream supports reading.

      Returns boolean

    • get canWrite(): boolean

      Whether the stream supports writing.

      Returns boolean

    • get canSeek(): boolean

      Whether the stream supports seeking.

      Returns boolean

    • get length(): number

      The length of the stream, in bytes.

      Returns number

    • get position(): number

      The current position within the stream.

      Returns number

    • set position(value: number): void

      Set the current position within the stream.

      Parameters

      • value: number

      Returns void

    • Copy data from this stream to another stream.

      Parameters

      • destination: Stream

        The stream that will receive the copied data.

      • bufferSize: number = 4096

        The temporary buffer size to use while copying.

      Returns void

    • Validate buffer, offset, and count arguments for stream read/write operations.

      Parameters

      • buffer: Uint8Array

        The buffer supplied by the caller.

      • offset: number

        The starting offset in the buffer.

      • count: number

        The number of bytes to read or write.

      Returns void

      offset or count does not specify a valid range in buffer.

    • Throw for an unsupported stream operation.

      Parameters

      • operation: string

        The unsupported operation name.

      Returns never

      Always thrown because the operation is unsupported.

    • Read bytes from the stream.

      Parameters

      • buffer: Uint8Array

        The buffer to read data into.

      • offset: number

        The offset into the buffer to start reading data.

      • count: number

        The number of bytes to read.

      Returns number

      The total number of bytes read into the buffer, or zero if the end of the stream has been reached.

    • Write bytes to the stream.

      Parameters

      • buffer: Uint8Array

        The buffer to write.

      • offset: number

        The offset of the first byte to write.

      • count: number

        The number of bytes to write.

      Returns void

    • Set the position within the stream.

      Parameters

      • offset: number

        The offset relative to origin.

      • origin: SeekOrigin

        The reference point used to obtain the new position.

      Returns number

      The new position within the stream.

    • Set the length of the stream.

      Parameters

      • value: number

        The desired length in bytes.

      Returns void

    • The stream's contents as a copy.

      Returns Uint8Array

      The copied stream contents.