BitWriter
in package
FinalYes
Writes variable-width bit fields to a binary buffer.
Inverse of the reader's BitReader — used to encode hint table entries for linearized PDF output per ISO 32000-2 Annex F.
Table of Contents
Methods
- alignToByte() : void
- Pad remaining bits in the current byte with zeros and advance.
- getBitPosition() : int
- Current position in bits.
- getData() : string
- Return the accumulated binary data as a string.
- writeBits() : void
- Write an unsigned integer of the given bit width.
- writeUint32() : void
- Write a 32-bit big-endian unsigned integer (for hint table headers).
Methods
alignToByte()
Pad remaining bits in the current byte with zeros and advance.
public
alignToByte() : void
getBitPosition()
Current position in bits.
public
getBitPosition() : int
Return values
intgetData()
Return the accumulated binary data as a string.
public
getData() : string
Return values
stringwriteBits()
Write an unsigned integer of the given bit width.
public
writeBits(int $value, int $count) : void
Parameters
- $value : int
-
Value to write
- $count : int
-
Number of bits to write (0–32), MSB first
writeUint32()
Write a 32-bit big-endian unsigned integer (for hint table headers).
public
writeUint32(int $value) : void
Parameters
- $value : int