@s2-dev/streamstore - v0.18.1
    Preparing search index...

    Function meteredBytes

    Low-level utilities for record bodies.

    • Calculate the metered size in bytes of a record (append or read). This includes the body and headers, but not metadata like timestamp.

      This function calculates how many bytes the record will occupy after being received and deserialized as raw bytes on the S2 side. For strings, it calculates UTF-8 byte length. For Uint8Array, it uses the array length directly (same value as would be used when encoding to base64 for transmission).

      Type Parameters

      • Format extends "string" | "bytes"

      Parameters

      Returns number

      The size in bytes