toBytes method

  1. @override
List<int> toBytes()

Returns a byte-sequence representation of this integer.

Returns a list of int, starting with the least significant byte.

Implementation

@override
List<int> toBytes() {
  var result = List<int>.filled(8, 0);
  result[0] = _l & 0xff;
  result[1] = (_l >> 8) & 0xff;
  result[2] = ((_m << 6) & 0xfc) | ((_l >> 16) & 0x3f);
  result[3] = (_m >> 2) & 0xff;
  result[4] = (_m >> 10) & 0xff;
  result[5] = ((_h << 4) & 0xf0) | ((_m >> 18) & 0xf);
  result[6] = (_h >> 4) & 0xff;
  result[7] = (_h >> 12) & 0xff;
  return result;
}