serializeU16 method

void serializeU16(
  1. int value
)

Implementation

void serializeU16(int value) {
  checkNumberRange(
    BigInt.from(value),
    BigInt.zero,
    BigInt.from(MAX_U16_NUMBER));

  int bytesLength = 2;
  _ensureBufferWillHandleSize(bytesLength);
  final bd = ByteData.sublistView(buffer);
  bd.setUint16(offset, value, Endian.little);
  offset += bytesLength;
}