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

    Interface MimeDecoder

    An interface for incrementally decoding content.

    interface MimeDecoder {
        encoding: ContentEncoding;
        clone(): MimeDecoder;
        estimateOutputLength(inputLength: number): number;
        decode(
            input: Uint8Array,
            startIndex: number,
            length: number,
            output: Uint8Array,
        ): number;
        reset(): void;
    }

    Implemented by

    Index
    encoding: ContentEncoding

    The encoding that the decoder supports.

    • Estimates the number of bytes needed to decode the specified number of input bytes.

      Parameters

      • inputLength: number

        The input length.

      Returns number

      The estimated output length.

    • Decodes the specified input into the output buffer.

      The output buffer should be large enough to hold all decoded input. Use estimateOutputLength to estimate the required size.

      Parameters

      • input: Uint8Array

        The input buffer.

      • startIndex: number

        The starting index of the input buffer.

      • length: number

        The length of the input range.

      • output: Uint8Array

        The output buffer.

      Returns number

      The number of bytes written to the output buffer.

      The input range is invalid or the output buffer is too small.