ByteArrayBuilder
Grow-on-demand byte buffer. Pure Kotlin (no platform OutputStream classes), so it works in commonMain across all targets — and it's faster than mutableListOf<Byte>() because it stores into a contiguous primitive array.
Public because consumers building or assembling byte streams (e.g. demo PDF generators in tests/samples) need the same primitive.
Functions
Append the low byte of each char in s directly — for pure-ASCII tokens (PDF keywords, numbers, operators). Avoids the transient ByteArray that s.encodeToByteArray() allocates per call. Callers must guarantee ASCII.
Append the base-10 ASCII representation of value directly into the buffer — no intermediate String. Used by the serializer for object numbers, generations and /Length, which are written per object.