encodeUint32

fnResult!(size_t, RleError) encodeUint32(scope const(uint)[] values, ubyte widthBytes, return scope ubyte[] dst) @safe nothrow @nogc

Encodes 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

valuesinput values.
widthByteselement width W (uint: 1/2/4).
dstcaller-provided output buffer (see maxEncodedSize).

Returns

Result!(size_t, RleError): bytes written.