|  |  |  | 
|---|
|  |  |  | return true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | public static void main(String[] args) throws Exception{ | 
|---|
|  |  |  | byte[] bs = new byte[]{(byte)0x38,(byte)0x1d,(byte)0x00,(byte)0x00,(byte)0x00} ; | 
|---|
|  |  |  | Long lg1 = ByteUtilUnsigned.bytes2Long_LE(bs, 0, 4) ; | 
|---|
|  |  |  | Long lg2 = ByteUtilUnsigned.bytes2Long_BE(bs, 0, 4) ; | 
|---|
|  |  |  | System.out.println(lg1); | 
|---|
|  |  |  | System.out.println(lg2); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //   public static void main(String[] args) throws Exception{ | 
|---|
|  |  |  | //      byte[] bs = new byte[]{(byte)0x38,(byte)0x1d,(byte)0x00,(byte)0x00,(byte)0x00} ; | 
|---|
|  |  |  | //      Long lg1 = ByteUtilUnsigned.bytes2Long_LE(bs, 0, 4) ; | 
|---|
|  |  |  | //      Long lg2 = ByteUtilUnsigned.bytes2Long_BE(bs, 0, 4) ; | 
|---|
|  |  |  | //      System.out.println(lg1); | 
|---|
|  |  |  | //      System.out.println(lg2); | 
|---|
|  |  |  | //   } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static void main(String[] args) throws Exception{ | 
|---|
|  |  |  | byte[] bs = new byte[]{0x02, 0x0C} ; | 
|---|
|  |  |  | int s = ByteUtilUnsigned.bytes2Short_BE(bs, 0) ; | 
|---|
|  |  |  | System.out.println(s); | 
|---|
|  |  |  | ////      int d = 123456; | 
|---|
|  |  |  | ////      byte[] bs = new byte[4] ; | 
|---|
|  |  |  | ////      int2Bytes_BE(bs, d, 0) ; | 
|---|
|  |  |  | 
|---|
|  |  |  | //      System.out.println(s); | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //   } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|