(byte[] ba)
| 24 | } |
| 25 | |
| 26 | public static String ByteArrayToString(byte[] ba) |
| 27 | { |
| 28 | if(ba == null) return null; |
| 29 | StringBuilder hex = new StringBuilder(ba.length * 2); |
| 30 | for(byte b : ba){ |
| 31 | hex.append(String.format("%02X", b)); |
| 32 | } |
| 33 | return hex.toString(); |
| 34 | } |
| 35 | |
| 36 | public static int getIntFromBytes(byte[] input,int offset){ |
| 37 | return ByteBuffer.wrap(Arrays.copyOfRange(input,offset, offset+4)).getInt(); |
no test coverage detected