/** * (non-Javadoc) * */ public String uninterpret(byte[] rawData, int offset, int length) { return ISOUtil.bcd2str (rawData, offset, length, leftPadded); }
public String getDestination() { return ISOUtil.bcd2str (this.header, 5, 6, false); } public void swapDirection() {
protected int getMessageLength() throws IOException, ISOException { byte[] b = new byte[2]; serverIn.readFully(b,0,2); return Integer.parseInt ( ISOUtil.bcd2str (b, 0, 4, true) ); } protected void sendMessageHeader(ISOMsg m, int len) throws IOException {
protected int getMessageLength() throws IOException, ISOException { byte[] b = new byte[2]; serverIn.readFully(b,0,2); return Integer.parseInt ( ISOUtil.bcd2str (b, 0, 4, true) ); } protected void sendMessageHeader(ISOMsg m, int len) throws IOException {
/** * Gets the BASE 1 Reject Code. * * @return If the message is a reject return the Reject Code Otherwise return "" */ public String getRejectCode() { return isRejected() ? ISOUtil.bcd2str (this.header, 24, 4, false) : ""; }
@Test(expected = ArrayIndexOutOfBoundsException.class) public void testBcd2strThrowsArrayIndexOutOfBoundsException() throws Throwable { byte[] b = new byte[41]; b[25] = (byte) -100; b[30] = (byte) 13; b[35] = (byte) -29; ISOUtil.bcd2str(b, 16, 61, true); }
@Test(expected = ArrayIndexOutOfBoundsException.class) public void testBcd2strThrowsArrayIndexOutOfBoundsException1() throws Throwable { byte[] b = new byte[41]; b[25] = (byte) -100; b[30] = (byte) 13; b[35] = (byte) -29; ISOUtil.bcd2str(b, 16, 61, false); }
public void unpack (ISOComponent c, InputStream in) throws IOException, ISOException { byte[] b = readBytes (in, 2); int len = 100 * (((b[0] >> 4 & 0x0F) > 0x09 ? 0 : b[0] >> 4 & 0x0F) * 10 + (b[0] & 0x0F)) + ((b[1] >> 4 & 0x0F) > 0x09 ? 0 : b[1] >> 4 & 0x0F) * 10 + (b[1] & 0x0F); c.setValue (ISOUtil.bcd2str (readBytes (in, len), 0, 2*len, pad)); }
@Test(expected = ArrayIndexOutOfBoundsException.class) public void testBcd2strThrowsArrayIndexOutOfBoundsException5() throws Throwable { byte[] b = new byte[25]; b[2] = (byte) -63; b[3] = (byte) 62; ISOUtil.bcd2str(b, 0, 100, true); }
@Test(expected = ArrayIndexOutOfBoundsException.class) public void testBcd2strThrowsArrayIndexOutOfBoundsException2() throws Throwable { byte[] b = new byte[25]; b[2] = (byte) -63; b[3] = (byte) 62; b[23] = (byte) 29; ISOUtil.bcd2str(b, 0, 100, true); }
@Test(expected = ArrayIndexOutOfBoundsException.class) public void testBcd2strThrowsArrayIndexOutOfBoundsException4() throws Throwable { byte[] b = new byte[2]; b[1] = (byte) 28; ISOUtil.bcd2str(b, 0, 27, true); }
@Test(expected = ArrayIndexOutOfBoundsException.class) public void testBcd2strThrowsArrayIndexOutOfBoundsException3() throws Throwable { byte[] b = new byte[41]; b[25] = (byte) -100; b[35] = (byte) -29; ISOUtil.bcd2str(b, 16, 61, false); }
@Test(expected = NegativeArraySizeException.class) public void testBcd2strThrowsNegativeArraySizeException() throws Throwable { byte[] b = new byte[3]; ISOUtil.bcd2str(b, 100, -1, true); }
@Test public void testBcd2str2() throws Throwable { byte[] b = new byte[2]; b[0] = (byte) -61; String result = ISOUtil.bcd2str(b, 0, 1, false); assertEquals("result", "C", result); }
@Test public void testBcd2str6() throws Throwable { byte[] b = new byte[3]; b[1] = (byte) 14; String result = ISOUtil.bcd2str(b, 0, 3, true); assertEquals("result", "00E", result); }
@Test public void testBcd2str1() throws Throwable { byte[] b = new byte[2]; String result = ISOUtil.bcd2str(b, 0, 2, true); assertEquals("result", "00", result); }
@Test public void testBcd2str4() throws Throwable { byte[] b = new byte[2]; b[0] = (byte) -31; String result = ISOUtil.bcd2str(b, 0, 1, false); assertEquals("result", "E", result); }
@Test public void testBcd2str() throws Throwable { byte[] b = new byte[0]; String result = ISOUtil.bcd2str(b, 100, 0, true); assertEquals("result", "", result); }
@Test public void testBcd2str3() throws Throwable { byte[] b = new byte[1]; b[0] = (byte) -3; String result = ISOUtil.bcd2str(b, 0, 1, true); assertEquals("result", "=", result); }
@Test public void testBcd2str5() throws Throwable { byte[] b = new byte[3]; String result = ISOUtil.bcd2str(b, 0, 1, true); assertEquals("result", "0", result); }