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

    Class FilteredStream

    A stream which filters data as it is read or written.

    Passes data through each IMimeFilter as the data is read or written.

    Hierarchy (View Summary)

    Index
    source: Stream

    The underlying stream to filter.

    • get canRead(): boolean

      Whether the filtered stream supports reading.

      The filtered stream only supports reading if the source stream supports it.

      Returns boolean

    • get canWrite(): boolean

      Whether the filtered stream supports writing.

      The filtered stream only supports writing if the source stream supports it.

      Returns boolean

    • get canSeek(): boolean

      Whether the filtered stream supports seeking.

      Seeking is not supported by filtered streams.

      Returns boolean

    • get length(): number

      Getting the length of a filtered stream is not supported.

      Returns number

    • get position(): number

      Getting the position of a filtered stream is not supported.

      Returns number

    • set position(_value: number): void

      Setting the position of a filtered stream is not supported.

      Parameters

      • _value: number

      Returns void

    • Add a filter to the end of the filter list.

      Data passes through filters as it is read from or written to the underlying source stream.

      Parameters

      Returns void

      filter is null or undefined.

    • Check whether the filtered stream contains the specified filter.

      Parameters

      Returns boolean

      true if the specified filter exists; otherwise, false.

      filter is null or undefined.

    • Read bytes from the filtered stream.

      Data read from the source stream is passed through each filter before being copied to buffer.

      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 filtered stream.

      Data is passed through each filter before being written to the source 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

    • Seeking is not supported by filtered streams.

      Parameters

      • _offset: number

        The offset relative to _origin.

      • _origin: SeekOrigin

        The reference point used to obtain the new position.

      Returns number

      Always thrown because the operation is unsupported.

    • Setting the length of a filtered stream is not supported.

      Parameters

      • _value: number

        The requested length.

      Returns void

      Always thrown because the operation is unsupported.

    • 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.