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

    Class BestEncodingFilter

    A filter that can be used to determine the most efficient content-transfer-encoding.

    Keeps track of the content that passes through the filter in order to determine the most efficient ContentEncoding to use.

    Hierarchy (View Summary)

    Index
    outputBuffer?: Uint8Array<ArrayBufferLike>

    The reusable output buffer used by this filter.

    • Get the best encoding given the specified constraints.

      Parameters

      • constraint: EncodingConstraint

        The encoding constraint.

      • maxLineLength: number = 78

        The maximum allowable line length, not counting CRLF. Must be between 60 and 998 inclusive.

      Returns ContentEncoding

      The best encoding.

      constraint is invalid or maxLineLength is outside the supported range.

    • Filter the specified input buffer.

      Parameters

      • input: Uint8Array

        The input buffer.

      • startIndex: number

        The starting index of the input buffer.

      • length: number

        The length of the input buffer, starting at startIndex.

      • _flush: boolean

        Whether all internally buffered data should be flushed to the output buffer.

      Returns MimeFilterResult

      The unmodified input range.

    • Filter the specified input buffer.

      Parameters

      • input: Uint8Array

        The input buffer.

      • startIndex: number

        The starting index of the input buffer.

      • length: number

        The number of bytes of input to filter.

      Returns MimeFilterResult

      The filtered output range.

      input is not a Uint8Array.

      startIndex and length do not specify a valid range in input.

    • Filter the specified input buffer, flushing all internally buffered data to the output.

      Parameters

      • input: Uint8Array

        The input buffer.

      • startIndex: number

        The starting index of the input buffer.

      • length: number

        The number of bytes of input to filter.

      Returns MimeFilterResult

      The filtered output range.

      input is not a Uint8Array.

      startIndex and length do not specify a valid range in input.

    • Save the remaining input for the next round of processing.

      Parameters

      • input: Uint8Array

        The input buffer.

      • startIndex: number

        The starting index of the buffer to save.

      • length: number

        The length of the buffer to save, starting at startIndex.

      Returns void

    • Ensure that the output buffer is at least the specified size.

      Parameters

      • size: number

        The minimum size needed.

      • keep: boolean

        Whether the current output should be preserved.

      Returns Uint8Array

      The output buffer.