File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed
msgpack-core/src/main/java/org/msgpack/core/buffer Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -60,13 +60,10 @@ public class MessageBuffer {
6060 byteBufferConstructor .setAccessible (true );
6161
6262 // Check the endian of this CPU
63-
6463 boolean isLittleEndian = true ;
6564 byte [] a = new byte [8 ];
66- unsafe .putLong (a , ARRAY_BYTE_BASE_OFFSET , 0x0102030405060708L );
67- // TODO Unsafe.getByte is not available in Android
68- byte b = unsafe .getByte (a , ARRAY_BYTE_BASE_OFFSET );
69- switch (b ) {
65+ unsafe .putLong (a , (long ) ARRAY_BYTE_BASE_OFFSET , 0x0102030405060708L );
66+ switch (a [0 ]) {
7067 case 0x01 :
7168 isLittleEndian = false ;
7269 break ;
@@ -81,6 +78,7 @@ public class MessageBuffer {
8178 msgBufferClass = Class .forName (bufferClsName );
8279 }
8380 catch (Exception e ) {
81+ e .printStackTrace (System .err );
8482 throw new RuntimeException (e );
8583 }
8684 }
Original file line number Diff line number Diff line change 3939
4040 <modules >
4141 <module >msgpack-core</module >
42- <module >msgpack-value</module >
4342 </modules >
4443
4544 <dependencyManagement >
You can’t perform that action at this time.
0 commit comments