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

    Class TnefReader

    A TNEF reader.

    Index
    • Creates a new TNEF reader.

      When reading with strict compliance, a TnefError is thrown immediately at the first sign of invalid or corrupted data. When reading with loose compliance, issues are accumulated in complianceStatus unless the stream is too corrupted to continue.

      Parameters

      • inputStream: Uint8Array<ArrayBufferLike> | Stream

        the input stream or bytes.

      • defaultMessageCodepage: number = 0

        the default message codepage.

      • complianceMode: TnefComplianceMode = 'loose'

        the compliance mode.

      Returns TnefReader

      defaultMessageCodepage is negative.

      the TNEF stream is corrupted or invalid in strict mode.

    tnefSignature: 574529400 = 0x223e9f78

    The expected TNEF stream signature.

    tnefPropertyReader: TnefPropertyReader

    Gets the TNEF property reader.

    complianceMode: TnefComplianceMode

    Gets the compliance mode.

    complianceStatus: TnefComplianceStatus = TnefComplianceStatus.Compliant

    Gets the current compliance status of the TNEF stream.

    As the reader progresses, this value may change if errors are encountered.

    attachmentKey: number = 0

    Gets the attachment key value.

    attributeLevel: TnefAttributeLevel = TnefAttributeLevel.Message

    Gets the current attribute's level.

    attributeTag: TnefAttributeTag = TnefAttributeTag.Null

    Gets the current attribute's tag.

    attributeRawValueLength: number = 0

    Gets the length of the current attribute's raw value.

    attributeRawValueStreamOffset: number = 0

    Gets the stream offset of the current attribute's raw value.

    tnefVersion: number = 0

    Gets the TNEF version.

    messageCodepage: number

    Gets the message codepage.

    • Set the message codepage.

      Invalid codepages are recorded as compliance issues and fall back to Windows-1252 unless strict mode raises a TnefError.

      Parameters

      • value: number

        the message codepage.

      Returns void

      value is invalid in strict mode.

    • Read the next TNEF attribute.

      Returns boolean

      true if another attribute is available; otherwise, false.

      the TNEF stream is corrupted or invalid in strict mode.

    • Read bytes from the current attribute's raw value.

      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 number of bytes read into the buffer.

      offset or count is out of range.

    • Peek at the next signed 32-bit integer without advancing the stream.

      Returns number

      the integer value.

    • Read a 32-bit floating point value.

      Returns number

      the floating point value.

    • Read a 64-bit floating point value.

      Returns number

      the floating point value.

    • Skip bytes in the TNEF stream.

      Parameters

      • count: number

        the number of bytes to skip.

      Returns boolean

      true if all bytes were skipped; otherwise, false.