writeFixInt64 method

void writeFixInt64(
  1. Int64 value,
  2. [Endian endian = Endian.big]
)

Writes 64-bit integer (Int64 from 'package:fixnum').

Implementation

void writeFixInt64(Int64 value, [Endian endian = Endian.big]) {
  ensureAvailableLength(8);

  final bytes = value.toBytes();
  final length = this._length;
  if (endian == Endian.little) {
    for (var i = 0; i < bytes.length; i++) {
      _byteData.setUint8(length + 7 - i, bytes[i]);
    }
  } else {
    for (var i = 0; i < bytes.length; i++) {
      _byteData.setUint8(length + i, bytes[i]);
    }
  }
  this._length = length + 8;
}