public static String byteArrayToHexString(byte[] in, int start, int length) {
        String asHexString = null;
        if (in != null) {
            StringBuilder out = new StringBuilder(in.length * 2);
            for (int x = start; x < length; x++) {
                int nybble = in[x] & 0xF0;
                nybble = nybble >>> 4;
                out.append(hexChars[nybble]);
                out.append(hexChars[in[x] & 0x0F]);
            }
            asHexString = out.toString();
        }
        return asHexString;
    }
@Test
    void testByteArrayToHex() {
        assertEquals("0123456789abcdef", byteArrayToHexString(array));
    }