readInt64 method

int readInt64()

Fetch a int32 from the bytes list Fetch a int64 from the bytes list Fetch a float64 from the bytes list Fetch a int64 from the bytes list Fetch a int64 from the bytes list

Implementation

// int readInt32() {
//   final start = ip;
//   ip += 4;
//   return bytes.buffer.asByteData().getInt32(start);
// }

/// Fetch a int64 from the bytes list
// int readInt64() {
//   final start = ip;
//   ip += 8;
//   return bytes.buffer.asByteData().getInt64(start);
// }

/// Fetch a float64 from the bytes list
// double readFloat64() {
//   final start = ip;
//   ip += 8;
//   return bytes.buffer.asByteData().getFloat64(start);
// }

/// Fetch a int64 from the bytes list
// int readInt64() {
//   final signMask = 1 << 31;
//   final highBits = bytes.buffer.asByteData().getUint32(ip, Endian.big);
//   final isNegative = (highBits & signMask) >> 31 == 1 ? -1 : 1;
//   final littleEnd = bytes.buffer.asByteData().getUint32(ip + 4, Endian.big);
//   ip += 8;
//   var bigEnd = highBits;
//   if (isNegative < 0) {
//     bigEnd = highBits - signMask;
//     return ((bigEnd << 32) + littleEnd) * -1 - 1;
//   } else {
//     return (bigEnd << 32) + littleEnd;
//   }
// }

/// Fetch a int64 from the bytes list
int readInt64() {
  final data = readUtf8String();
  final number = int.parse(data);
  return number;
}