pack method

void pack(
  1. dynamic out,
  2. int offset,
  3. Endian endian
)

Packs a 64 bit integer into a byte buffer. The out parameter can be an Uint8List or a ByteData if you will run it several times against the same buffer and want faster execution.

Implementation

void pack(dynamic out, int offset, Endian endian) {
  switch (endian) {
    case Endian.big:
      pack32(hi32, out, offset, endian);
      pack32(lo32, out, offset + 4, endian);
      break;

    case Endian.little:
      pack32(hi32, out, offset + 4, endian);
      pack32(lo32, out, offset, endian);
      break;

    default:
      throw UnsupportedError('Invalid endianness: $endian');
  }
}