From 539999b94c603c1f67c1f15421df3a2f36292dc0 Mon Sep 17 00:00:00 2001 From: hasToDev Date: Tue, 15 Aug 2023 16:25:10 +0700 Subject: [PATCH] fix readLong on Web --- lib/src/xdr/xdr_data_io.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/xdr/xdr_data_io.dart b/lib/src/xdr/xdr_data_io.dart index c3a1a7e..536a898 100644 --- a/lib/src/xdr/xdr_data_io.dart +++ b/lib/src/xdr/xdr_data_io.dart @@ -105,7 +105,9 @@ class DataInput { _offset = _offset! + 8; if (kIsWeb) { - BigInt bigInt = decodeBigInt(view!.buffer.asUint8List(oldOffset!)); + List buffer = view!.buffer.asUint8List(oldOffset!); + if (buffer.length > 8) buffer = buffer.sublist(0, 8); + BigInt bigInt = decodeBigInt(buffer); return bigInt.toInt(); } else { return view!.getInt64(oldOffset!, endian);