encodeShort static method

void encodeShort(
  1. int value,
  2. Int8List buf
)

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

Implementation

static void encodeShort(final int value, final Int8List buf) {
  buf[0] = (0xff & (value >> 8)).toSigned(8);
  buf[1] = (0xff & (value)).toSigned(8);
}