BinaryBufferWriter implements BinaryWriter
FinalYes
Interfaces
Methods
- __construct() : mixed
- append() : void
- length() : DataSize
- writeBits() : void
- writeBytes() : void
- writeVarInts() : void
- Write values using variable-length encoding (VarInt/ULEB128).
Methods
__construct()
public
__construct(string &$buffer) : mixed
Parameters
- $buffer : string
append()
public
append(string $buffer) : void
Parameters
- $buffer : string
length()
public
length() : DataSize
Return values
DataSizewriteBits()
public
writeBits(array<string|int, mixed> $bits) : void
Parameters
- $bits : array<string|int, mixed>
writeBytes()
public
writeBytes(array<string|int, mixed> $bytes) : void
Parameters
- $bytes : array<string|int, mixed>
writeVarInts()
Write values using variable-length encoding (VarInt/ULEB128).
public
writeVarInts(array<string|int, mixed> $values) : void
VarInt encoding uses the most significant bit of each byte as a continuation bit. Values are encoded in little-endian byte order with 7 bits of data per byte. Negative values are treated as unsigned 64-bit integers for proper encoding. This method handles all edge cases including overflow and ZigZag encoded values.
Parameters
- $values : array<string|int, mixed>