Return the written portion of the buffer as a Uint8Array view. The returned view shares underlying memory with the writer.
Pad cursor to next 4-byte boundary with zero bytes. Required before writing U32/I32 values and for format compliance.
Write raw bytes, advancing cursor by bytes.byteLength.
Write signed 32-bit integer (little-endian), advancing cursor by 4 bytes. Requires cursor to be 4-byte aligned.
Write unsigned 32-bit integer (little-endian), advancing cursor by 4 bytes. Requires cursor to be 4-byte aligned.
Write unsigned 8-bit integer, advancing cursor by 1 byte.
Bounds-checked binary writer with cursor tracking.
Ownership: BinaryWriter owns its internal buffer. The buffer returned by finish() is a subarray view; caller should copy if the writer will be reused.