encodeLength
private fn
void encodeLength(ref ubyte * p, size_t length) nothrow @nogcEncode a length value using LZ4's variable-length encoding scheme.
LZ4 encodes lengths that exceed the 4-bit token capacity (15) using extension bytes. If the initial 4-bit value is 15, additional bytes follow: each byte with value 255 adds 255 to the length, and a final byte with value < 255 terminates the sequence.
This function emits the extension bytes only (not the initial 4-bit value in the token). The caller is responsible for setting the token nibble to 15 when length >= 15.
Parameters
p | Pointer to current write position; advanced past bytes written. |
length | The length value to encode (already reduced by the token nibble). |