edgeport - v1.0.6
    Preparing search index...

    Class StreamFramedReader

    FramedReader backed by a ReadableStream of bytes.

    Implements

    Index
    • Returns the next n bytes without consuming them.

      Parameters

      • n: number

        Number of bytes to inspect.

      • OptionaltimeoutMs: number

        Optional deadline.

      Returns Promise<Uint8Array<ArrayBufferLike>>

      A copy of the next n bytes.

    • Reads one line terminated by LF, returning it decoded as UTF-8 with the trailing CRLF or LF stripped. Suitable for the text line protocols (SMTP, IMAP, POP3).

      Parameters

      • OptionaltimeoutMs: number

        Optional deadline.

      Returns Promise<string>

      The line without its terminator.

    • Reads and consumes exactly n bytes.

      Parameters

      • n: number

        Number of bytes to read.

      • OptionaltimeoutMs: number

        Optional deadline; rejects with TimeoutError if exceeded.

      Returns Promise<Uint8Array<ArrayBufferLike>>

      The n bytes read.

      If the stream ends before n bytes are available.

      If timeoutMs elapses first.

    • Reads and consumes bytes up to and including the first occurrence of delim.

      Parameters

      • delim: Uint8Array

        The delimiter to scan for.

      • Optionalmax: number

        Optional cap on bytes scanned before failing (guards against a peer that never sends the delimiter).

      • OptionaltimeoutMs: number

        Optional deadline.

      Returns Promise<Uint8Array<ArrayBufferLike>>

      Everything up to and including delim.

      If the stream ends first, or max is exceeded.

      If timeoutMs elapses first.

    • Releases the underlying stream lock without cancelling the stream.

      Used when a starttls upgrade swaps the socket: the old reader must relinquish its lock so the new socket's streams can be locked, without cancelling the (discarded) old stream.

      Returns void