String ebcdicOfHex(char hexbyte) {
String ebcdic = null;
switch(hexbyte) {
case 0x00: ebcdic = "<NUL>"; break;
case 0x01: ebcdic = "<SOH>"; break;
case 0x02: ebcdic = "<STX>"; break;
case 0x03: ebcdic = "<ETX>"; break;
case 0x04: ebcdic = "<SEL>"; break;
case 0x05: ebcdic = "<HT>" ; break;
case 0x06: ebcdic = "<RNL>"; break;
case 0x07: ebcdic = "<DEL>"; break;
case 0x08: ebcdic = "<GE>" ; break;
case 0x09: ebcdic = "<SPS>"; break;
case 0x0A: ebcdic = "<RPT>"; break;
case 0x0B: ebcdic = "<VT>" ; break;
case 0x0C: ebcdic = "<FF>" ; break;
case 0x0D: ebcdic = "\r"; break;
case 0x0E: ebcdic = "<SO>" ; break;
case 0x0F: ebcdic = "<SI>" ; break;
case 0x10: ebcdic = "<DLE>"; break;
case 0x11: ebcdic = "<DC1>"; break;
case 0x12: ebcdic = "<DC2>"; break;
case 0x13: ebcdic = "<DC3>"; break;
case 0x14: ebcdic = "<RES/ENP>"; break;
case 0x15: ebcdic = "\n" ; break;
case 0x16: ebcdic = "<BS>" ; break;
case 0x17: ebcdic = "<POC>"; break;
case 0x18: ebcdic = "<CAN>"; break;
case 0x19: ebcdic = "<EM>" ; break;
case 0x1A: ebcdic = "<UBS>"; break;
case 0x1B: ebcdic = "<CU1>"; break;
case 0x1C: ebcdic = "<IFS>"; break;
case 0x1D: ebcdic = "<IGS>" ; break;
case 0x1E: ebcdic = "<IRS>"; break;
case 0x1F: ebcdic = "<ITB/IUS>"; break;
case 0x20: ebcdic = "<DS>" ; break;
case 0x21: ebcdic = "<SOS>"; break;
case 0x22: ebcdic = "<FS>" ; break;
case 0x23: ebcdic = "<WUS>"; break;
case 0x24: ebcdic = "<BYP/INP>"; break;
case 0x25: ebcdic = "<LF>" ; break;
case 0x26: ebcdic = "<ETB>"; break;
case 0x27: ebcdic = "<ESC>"; break;
case 0x28: ebcdic = "<SA>" ; break;
case 0x29: ebcdic = "<SFE>"; break;
case 0x2A: ebcdic = "<SM/SW>"; break;
case 0x2B: ebcdic = "<CSP>"; break;
case 0x2C: ebcdic = "<MFA>"; break;
case 0x2D: ebcdic = "<ENQ>"; break;
case 0x2E: ebcdic = "<ACK>"; break;
case 0x2F: ebcdic = "<BEL>"; break;
case 0x30: break;
case 0x31: break;
case 0x32: ebcdic = "<SYN>"; break;
case 0x33: ebcdic = "<IR>" ; break;
case 0x34: ebcdic = "<PP>" ; break;
case 0x35: ebcdic = "<TRN>"; break;
case 0x36: ebcdic = "<NBS>"; break;
case 0x37: ebcdic = "<EOT>"; break;
case 0x38: ebcdic = "<SBS>"; break;
case 0x39: ebcdic = "<IT>" ; break;
case 0x3A: ebcdic = "<RFF>"; break;
case 0x3B: ebcdic = "<CU3>"; break;
case 0x3C: ebcdic = "<DC4>"; break;
case 0x3D: ebcdic = "<NAK>"; break;
case 0x3E: break;
case 0x3F: ebcdic = "<SUB>"; break;
case 0x40: ebcdic = " " ; break;
case 0x41: ebcdic = "<RSP>"; break;
case 0x42: break;
case 0x43: break;
case 0x44: break;
case 0x45: break;
case 0x46: break;
case 0x47: break;
case 0x48: break;
case 0x49: break;
case 0x4A: ebcdic = "["; break;
case 0x4B: ebcdic = "."; break;
case 0x4C: ebcdic = "<"; break;
case 0x4D: ebcdic = "("; break;
case 0x4E: ebcdic = "+"; break;
case 0x4F: ebcdic = "|"; break;
case 0x50: ebcdic = "&"; break;
case 0x51: break;
case 0x52: break;
case 0x53: break;
case 0x54: break;
case 0x55: break;
case 0x56: break;
case 0x57: break;
case 0x58: break;
case 0x59: break;
case 0x5A: ebcdic = "!"; break;
case 0x5B: ebcdic = "$"; break;
case 0x5C: ebcdic = "*"; break;
case 0x5D: ebcdic = ")"; break;
case 0x5E: ebcdic = ";"; break;
case 0x5F: ebcdic = "^"; break;
case 0x60: ebcdic = "_"; break;
case 0x61: ebcdic = "/"; break;
case 0x62: break;
case 0x63: break;
case 0x64: break;
case 0x65: break;
case 0x66: break;
case 0x67: break;
case 0x68: break;
case 0x69: break;
case 0x6A: ebcdic = "|"; break;
case 0x6B: ebcdic = ","; break;
case 0x6C: ebcdic = "%"; break;
case 0x6D: ebcdic = "_"; break;
case 0x6E: ebcdic = ">"; break;
case 0x6F: ebcdic = "?"; break;
case 0x70: break;
case 0x71: break;
case 0x72: break;
case 0x73: break;
case 0x74: break;
case 0x75: break;
case 0x76: break;
case 0x77: break;
case 0x78: break;
case 0x79: ebcdic = "`"; break;
case 0x7A: ebcdic = ":"; break;
case 0x7B: ebcdic = "#"; break;
case 0x7C: ebcdic = "@"; break;
case 0x7D: ebcdic = "\""; break;
case 0x7E: ebcdic = "="; break;
case 0x7F: ebcdic = "\""; break;
case 0x80: break;
case 0x81: ebcdic = "a"; break;
case 0x82: ebcdic = "b"; break;
case 0x83: ebcdic = "c"; break;
case 0x84: ebcdic = "d"; break;
case 0x85: ebcdic = "e"; break;
case 0x86: ebcdic = "f"; break;
case 0x87: ebcdic = "g"; break;
case 0x88: ebcdic = "h"; break;
case 0x89: ebcdic = "i"; break;
case 0x8A: break;
case 0x8B: ebcdic = "{"; break;
case 0x8C: break;
case 0x8D: break;
case 0x8E: break;
case 0x8F: ebcdic = "+"; break;
case 0x90: break;
case 0x91: ebcdic = "j"; break;
case 0x92: ebcdic = "k"; break;
case 0x93: ebcdic = "l"; break;
case 0x94: ebcdic = "m"; break;
case 0x95: ebcdic = "n"; break;
case 0x96: ebcdic = "o"; break;
case 0x97: ebcdic = "p"; break;
case 0x98: ebcdic = "q"; break;
case 0x99: ebcdic = "r"; break;
case 0x9A: break;
case 0x9B: ebcdic = "}"; break;
case 0x9C: break;
case 0x9D: break;
case 0x9E: break;
case 0x9F: break;
case 0xA0: break;
case 0xA1: ebcdic = "~"; break;
case 0xA2: ebcdic = "s"; break;
case 0xA3: ebcdic = "t"; break;
case 0xA4: ebcdic = "u"; break;
case 0xA5: ebcdic = "v"; break;
case 0xA6: ebcdic = "w"; break;
case 0xA7: ebcdic = "x"; break;
case 0xA8: ebcdic = "y"; break;
case 0xA9: ebcdic = "z"; break;
case 0xAA: break;
case 0xAB: break;
case 0xAC: break;
case 0xAD: ebcdic = "["; break;
case 0xAE: break;
case 0xAF: break;
case 0xB0: break;
case 0xB1: break;
case 0xB2: break;
case 0xB3: break;
case 0xB4: break;
case 0xB5: break;
case 0xB6: break;
case 0xB7: break;
case 0xB8: break;
case 0xB9: break;
case 0xBA: break;
case 0xBB: break;
case 0xBC: break;
case 0xBD: break;
case 0xBE: break;
case 0xBF: break;
case 0xC0: ebcdic = "{"; break;
case 0xC1: ebcdic = "A"; break;
case 0xC2: ebcdic = "B"; break;
case 0xC3: ebcdic = "C"; break;
case 0xC4: ebcdic = "D"; break;
case 0xC5: ebcdic = "E"; break;
case 0xC6: ebcdic = "F"; break;
case 0xC7: ebcdic = "G"; break;
case 0xC8: ebcdic = "H"; break;
case 0xC9: ebcdic = "I"; break;
case 0xCA: break;
case 0xCB: break;
case 0xCC: break;
case 0xCD: break;
case 0xCE: break;
case 0xCF: break;
case 0xD0: ebcdic = "}"; break;
case 0xD1: ebcdic = "J"; break;
case 0xD2: ebcdic = "K"; break;
case 0xD3: ebcdic = "L"; break;
case 0xD4: ebcdic = "M"; break;
case 0xD5: ebcdic = "N"; break;
case 0xD6: ebcdic = "O"; break;
case 0xD7: ebcdic = "P"; break;
case 0xD8: ebcdic = "Q"; break;
case 0xD9: ebcdic = "R"; break;
case 0xDA: break;
case 0xDB: break;
case 0xDC: break;
case 0xDD: break;
case 0xDE: break;
case 0xDF: break;
case 0xE0: ebcdic = "\\"; break;
case 0xE1: break;
case 0xE2: ebcdic = "S"; break;
case 0xE3: ebcdic = "T"; break;
case 0xE4: ebcdic = "U"; break;
case 0xE5: ebcdic = "V"; break;
case 0xE6: ebcdic = "W"; break;
case 0xE7: ebcdic = "X"; break;
case 0xE8: ebcdic = "Y"; break;
case 0xE9: ebcdic = "Z"; break;
case 0xEA: break;
case 0xEB: break;
case 0xEC: break;
case 0xED: break;
case 0xEE: break;
case 0xEF: break;
case 0xF0: ebcdic = "0"; break;
case 0xF1: ebcdic = "1"; break;
case 0xF2: ebcdic = "2"; break;
case 0xF3: ebcdic = "3"; break;
case 0xF4: ebcdic = "4"; break;
case 0xF5: ebcdic = "5"; break;
case 0xF6: ebcdic = "6"; break;
case 0xF7: ebcdic = "7"; break;
case 0xF8: ebcdic = "8"; break;
case 0xF9: ebcdic = "9"; break;
case 0xFA: break;
case 0xFB: break;
case 0xFC: break;
case 0xFD: break;
case 0xFE: break;
case 0xFF: break;
default : ebcdic = "<<UNHANDLED CODE>>"; break;
}
return ebcdic;
}
|