public static String toHex(byte[] b, int offset, int length) {
        Preconditions.checkArgument(length <= Integer.MAX_VALUE / 2);
        int numChars = length * 2;
        char[] ch = new char[numChars];
        for (int i = 0; i < numChars; i += 2) {
            byte d = b[offset + i / 2];
            ch[i] = HEX_CHARS[(d >> 4) & 0x0F];
            ch[i + 1] = HEX_CHARS[d & 0x0F];
        }
        return new String(ch);
    }
Convert a byte range into a hex string
stroom-bytebuffer/src/main/java/stroom/bytebuffer/hbase/Bytes.java