pack32 function

void pack32(
  1. int x,
  2. dynamic out,
  3. int offset,
  4. Endian endian,
)

Packs a 32 bit integer into a byte buffer. The out parameter can be an Uint8List or a ByteData if you will run it several times against the same buffer and want faster execution.

Implementation

void pack32(int x, dynamic out, int offset, Endian endian) {
  // Обеспечиваем 32-битное значение даже для больших чисел
  x = x & _MASK_32;
  if (out is! ByteData) {
    out =
        ByteData.view(out.buffer as ByteBuffer, out.offsetInBytes, out.length);
  }
  out.setUint32(offset, x, endian);
}