pamoja for TypeScript - v0.1.17
    Preparing search index...

    Interface Framing

    One of the two byte-stuffing framings this module offers.

    interface Framing {
        decode(frame: Uint8Array): Buffer;
        encode(payload: Uint8Array): Buffer;
        maxEncodedLen(payloadLen: number): number;
    }
    Index
    • Reads the payload back out of a complete frame.

      Parameters

      • frame: Uint8Array

        The frame as it arrived.

      Returns Buffer

      The payload.

      If the frame is corrupt.

    • Frames a payload for the wire.

      Parameters

      • payload: Uint8Array

        The bytes to send.

      Returns Buffer

      The frame, delimiter included.

    • Returns the largest frame a payload of this length can produce.

      Parameters

      • payloadLen: number

        The payload length in bytes.

      Returns number

      The worst-case frame length.