class Hexer {

    public static String stringify(byte[] data) {
        StringBuilder sb = new StringBuilder();
        for (byte b : data) {
            sb.append(String.format("0x%02x ", b & 0xff));
        }
        sb.deleteCharAt(sb.length() - 1);
        return sb.toString();
    }

}