encodeFixed32 function

List<int> encodeFixed32(
  1. List<int> buffer,
  2. int value
)

Appends 4 little-endian bytes representing value as an unsigned 32-bit integer to buffer.

The value is masked to 32 bits before encoding so that only the lowest 4 bytes are emitted regardless of the Dart int's full 64-bit range.

Returns the same buffer list with the 4 bytes appended, allowing fluent chaining.

Implementation

List<int> encodeFixed32(List<int> buffer, int value) {
  buffer.add(value & 0xFF);
  buffer.add((value >>> 8) & 0xFF);
  buffer.add((value >>> 16) & 0xFF);
  buffer.add((value >>> 24) & 0xFF);
  return buffer;
}