@@ -48,15 +48,14 @@ class Int64 implements IntX {
4848 (bytes[0 ] & 0xFF ));
4949
5050 /// Constructs an [Int64] from the first 8 bytes in [bytes] , as big endian.
51- factory Int64 .fromBytesBigEndian (List <int > bytes) =>
52- Int64 (((bytes[0 ] & 0xFF ) << 56 ) |
53- ((bytes[1 ] & 0xFF ) << 48 ) |
54- ((bytes[2 ] & 0xFF ) << 40 ) |
55- ((bytes[3 ] & 0xFF ) << 32 ) |
56- ((bytes[4 ] & 0xFF ) << 24 ) |
57- ((bytes[5 ] & 0xFF ) << 16 ) |
58- ((bytes[6 ] & 0xFF ) << 8 ) |
59- (bytes[7 ] & 0xFF ));
51+ factory Int64 .fromBytesBigEndian (List <int > bytes) => Int64 ((bytes[7 ] & 0xFF ) |
52+ ((bytes[6 ] & 0xFF ) << 8 ) |
53+ ((bytes[5 ] & 0xFF ) << 16 ) |
54+ ((bytes[4 ] & 0xFF ) << 24 ) |
55+ ((bytes[3 ] & 0xFF ) << 32 ) |
56+ ((bytes[2 ] & 0xFF ) << 40 ) |
57+ ((bytes[1 ] & 0xFF ) << 48 ) |
58+ ((bytes[0 ] & 0xFF ) << 56 ));
6059
6160 /// Parses [source] as a decimal numeral.
6261 ///
@@ -310,14 +309,14 @@ class Int64 implements IntX {
310309 @override
311310 List <int > toBytes () {
312311 final result = List <int >.filled (8 , 0 );
313- result[0 ] = _i & 0xff ;
314- result[1 ] = (_i >> 8 ) & 0xff ;
315- result[2 ] = (_i >> 16 ) & 0xff ;
316- result[3 ] = (_i >> 24 ) & 0xff ;
317- result[4 ] = (_i >> 32 ) & 0xff ;
318- result[5 ] = (_i >> 40 ) & 0xff ;
319- result[6 ] = (_i >> 48 ) & 0xff ;
320312 result[7 ] = (_i >> 56 ) & 0xff ;
313+ result[6 ] = (_i >> 48 ) & 0xff ;
314+ result[5 ] = (_i >> 40 ) & 0xff ;
315+ result[4 ] = (_i >> 32 ) & 0xff ;
316+ result[3 ] = (_i >> 24 ) & 0xff ;
317+ result[2 ] = (_i >> 16 ) & 0xff ;
318+ result[1 ] = (_i >> 8 ) & 0xff ;
319+ result[0 ] = _i & 0xff ;
321320 return result;
322321 }
323322
0 commit comments