Int64.fromBytesBigEndian constructor

Int64.fromBytesBigEndian(
  1. List<int> bytes
)

Implementation

factory Int64.fromBytesBigEndian(List<int> bytes) {
  int top = bytes[0] & 0xff;
  top <<= 8;
  top |= bytes[1] & 0xff;
  top <<= 8;
  top |= bytes[2] & 0xff;
  top <<= 8;
  top |= bytes[3] & 0xff;

  int bottom = bytes[4] & 0xff;
  bottom <<= 8;
  bottom |= bytes[5] & 0xff;
  bottom <<= 8;
  bottom |= bytes[6] & 0xff;
  bottom <<= 8;
  bottom |= bytes[7] & 0xff;

  return Int64.fromInts(top, bottom);
}