encodeWord static method

void encodeWord(
  1. int n,
  2. Int8List buf, [
  3. int off = 0
])

Encode a big-endian 32-bit integer into an Int8List.

Implementation

static void encodeWord(final int n, final Int8List buf, [int off = 0]) {
  buf[0 + off] = ((n >> 24) & 0xff);
  buf[1 + off] = ((n >> 16) & 0xff);
  buf[2 + off] = ((n >> 8) & 0xff);
  buf[3 + off] = ((n) & 0xff);
}