writeListUint16 method

int writeListUint16(
  1. List<int> values
)

Write the given list of unsigned 16-bit integer values.

Implementation

int writeListUint16(List<int> values) {
  assert(!_inVTable);
  _prepare(_sizeofUint32, 1, additionalBytes: 2 * values.length);
  final result = _tail;
  var tail = _tail;
  _setUint32AtTail(tail, values.length);
  tail -= _sizeofUint32;
  for (final value in values) {
    _setUint16AtTail(tail, value);
    tail -= _sizeofUint16;
  }
  return result;
}