@itsaorg/dbms-base
    Preparing search index...

    Interface DbmsBufferizerInterface

    Turns a payload into a DBMS byte frame and reads it back.

    💡 encode adds the header. decode checks it and returns the payload.

    import type { DbmsBufferizerInterface } from "@itsaorg/dbms-base";

    function roundTrip(codec: DbmsBufferizerInterface, payload: Uint8Array): Uint8Array {
    return codec.decode(codec.encode(payload));
    }
    interface DbmsBufferizerInterface {
        decode(buffer: Uint8Array): Uint8Array;
        encode(payload: Uint8Array): Uint8Array;
    }

    Implemented by

    Index
    • Reads a payload out of a DBMS envelope.

      Parameters

      • buffer: Uint8Array

        The framed bytes.

      Returns Uint8Array

      The payload that was framed.

    • Wraps a payload in a DBMS envelope.

      Parameters

      • payload: Uint8Array

        The bytes to frame.

      Returns Uint8Array

      The header followed by the payload.