async function readLong(
  buf,
) {
  const high = await readInt(buf);
  if (high === null) return null;
  const low = await readInt(buf);
  if (low === null) throw new Deno.errors.UnexpectedEof();
  const big = BigInt(high) << 32n | BigInt(low);
  // We probably should provide a similar API that returns BigInt values.
  if (big > MAX_SAFE_INTEGER) {
    throw new RangeError(
      "Long value too big to be represented as a JavaScript number.",
    );
  }
  return Number(big);
}
/** Read big endian 64bit long from BufReader */
Read big endian 64bit long from BufReader
Read big endian 64bit long from BufReader
async function readLong(
  buf,
) {
  const high = await readInt(buf);
  if (high === null) return null;
  const low = await readInt(buf);
  if (low === null) throw new Deno.errors.UnexpectedEof();
  const big = BigInt(high) << 32n | BigInt(low);
  if (big > MAX_SAFE_INTEGER) {
    throw new RangeError(
      "Long value too big to be represented as a JavaScript number.",
    );
  }
  return Number(big);
}
async function readLong ( buf , ) { const high = await readInt ( buf ) ; if ( high === null ) return null ; const low = await readInt ( buf ) ; if ( low === null ) throw new Deno . errors . UnexpectedEof ( ) ; const big = BigInt ( high ) << 32n | BigInt ( low ) ; if ( big > MAX_SAFE_INTEGER ) { throw new RangeError ( "Long value too big to be represented as a JavaScript number." , ) ; } return Number ( big ) ; }
Read big endian 64bit long from BufReader
Read big endian 64bit long from BufReader
// We probably should provide a similar API that returns BigInt values.