@Test public void testUninterpretUnsigned() throws Exception { byte[] rawData = new byte[] { (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0xf1, (byte) 0xf3, (byte) 0xf5, (byte) 0xf7, (byte) 0xf8, (byte) 0xf6, (byte) 0x12, (byte) 0x9a }; int offset = 3; int length = 6; String expectedString = "135786"; assertEquals(expectedString, signedEbcdicNumberInterpreter.uninterpret(rawData, offset, length)); }
public String uninterpret(byte[] rawData, int offset, int length) { boolean negative = (byte) (rawData[offset + length - 1] & 0xF0) == (byte)0xD0; rawData[offset + length - 1] = (byte) (rawData[offset + length - 1] | 0xF0); return (negative ? "-" : "") + ISOUtil.ebcdicToAscii(rawData, offset, length); }
SignedEbcdicNumberInterpreter implements Interpreter { public String uninterpret(byte[] rawData, int offset, int length) { boolean negative = (byte) (rawData[offset + length - 1] & 0xF0) == (byte)0xD0; rawData[offset + length - 1] = (byte) (rawData[offset + length - 1] | 0xF0); return (negative ? "-" : "") + ISOUtil.ebcdicToAscii(rawData, offset, length); } }
SignedEbcdicNumberInterpreter implements Interpreter { public String uninterpret(byte[] rawData, int offset, int length) { boolean negative = (byte) (rawData[offset + length - 1] & 0xF0) == (byte)0xD0; rawData[offset + length - 1] = (byte) (rawData[offset + length - 1] | 0xF0); return (negative ? "-" : "") + ISOUtil.ebcdicToAscii(rawData, offset, length); }  }
SignedEbcdicNumberInterpreter implements Interpreter { public String uninterpret(byte[] rawData, int offset, int length) { boolean negative = (byte) (rawData[offset + length - 1] & 0xF0) == (byte)0xD0; rawData[offset + length - 1] = (byte) (rawData[offset + length - 1] | 0xF0); return (negative ? "-" : "") + ISOUtil.ebcdicToAscii(rawData, offset, length); }  void interpret(String data, byte[] targetArray, int offset); String uninterpret(byte[] rawData, int offset, int length); int getPackedLength(int nDataUnits); }
SignedEbcdicNumberInterpreter implements Interpreter { public String uninterpret(byte[] rawData, int offset, int length) { boolean negative = (byte) (rawData[offset + length - 1] & 0xF0) == (byte)0xD0; rawData[offset + length - 1] = (byte) (rawData[offset + length - 1] | 0xF0); return (negative ? "-" : "") + ISOUtil.ebcdicToAscii(rawData, offset, length); }  void interpret(String data, byte[] targetArray, int offset); String uninterpret(byte[] rawData, int offset, int length); int getPackedLength(int nDataUnits); static final SignedEbcdicNumberInterpreter INSTANCE; }