char (byte[] ord) { int d1 = Character.digit((char)ord[0], 16); if (d1 == -1) return INVALID_CHAR; int d2 = Character.digit((char)ord[1], 16); if (d2 == -1) return INVALID_CHAR; int d3 = Character.digit((char)ord[2], 16); if (d3 == -1) return INVALID_CHAR; int d4 = Character.digit((char)ord[3], 16); if (d4 == -1) return INVALID_CHAR; int b1 = (d1 << 12) & 0xF000; int b2 = (d2 << 8) & 0x0F00; int b3 = (d3 << 4) & 0x00F0; int b4 = (d4) & 0x000F; int code = b1 | b2 | b3 | b4; if (Character.isWhitespace((char)code)) return INVALID_CHAR; return (char)code; }