Int64.fromBytes constructor

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

Implementation

factory Int64.fromBytes(List<int> bytes) {
  int top = bytes[7] & 0xff;
  top <<= 8;
  top |= bytes[6] & 0xff;
  top <<= 8;
  top |= bytes[5] & 0xff;
  top <<= 8;
  top |= bytes[4] & 0xff;

  int bottom = bytes[3] & 0xff;
  bottom <<= 8;
  bottom |= bytes[2] & 0xff;
  bottom <<= 8;
  bottom |= bytes[1] & 0xff;
  bottom <<= 8;
  bottom |= bytes[0] & 0xff;

  return Int64.fromInts(top, bottom);
}