Result!(size_t, RleError): bytes written.encodeUint32
fn
Result!(size_t, RleError) encodeUint32(scope const(uint)[] values,
ubyte widthBytes, return scope ubyte[] dst) @safe nothrow @nogcEncodes values into a DDN-RLE/1 stream at element width W.
Greedy and deterministic: maximal runs of length ≥ 2 become RUN tokens, everything else accumulates into LITERAL tokens (each capped at 2³¹ − 1 values). Values are pre-checked against W bytes (INVALID_VALUE with the index — the buffer is untouched); a capacity failure commits only complete tokens and reports that prefix (bytes, values).
Parameters
values | input values. |
widthBytes | element width W (uint: 1/2/4). |
dst | caller-provided output buffer (see maxEncodedSize). |