package org.mitallast.queue.common;

public final class Hex {
    public static byte[] parseHexBinary(String s) {
        int len = s.length();
        byte[] data = new byte[len / 2];
        for (int i = 0; i < len; i += 2) {
            data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
                + Character.digit(s.charAt(i + 1), 16));
        }
        return data;
    }
}

@@ -55,16 +55,95 @@
 s Hex %7B%0A
+    private static final char%5B%5D HEX_ARRAY = %220123456789ABCDEF%22.toCharArray();%0A%0A
     publ
@@ -467,11 +467,366 @@
 a;%0A    %7D
+%0A%0A    public static String printHexBinary(byte%5B%5D bytes) %7B%0A        char%5B%5D hexChars = new char%5Bbytes.length * 2%5D;%0A        for (int j = 0; j %3C bytes.length; j++) %7B%0A            int v = bytes%5Bj%5D & 0xFF;%0A            hexChars%5Bj * 2%5D = HEX_ARRAY%5Bv %3E%3E%3E 4%5D;%0A            hexChars%5Bj * 2 + 1%5D = HEX_ARRAY%5Bv & 0x0F%5D;%0A        %7D%0A        return new String(hexChars);%0A    %7D
 %0A%7D%0A

add hex util