@Test public void testUnpackThrowsArrayIndexOutOfBoundsException() throws Throwable { byte[] b = new byte[0]; ISOComponent c = new ISOMsg(); try { new Base1_BITMAP126().unpack(c, b, 100); fail("Expected ArrayIndexOutOfBoundsException to be thrown"); } catch (ArrayIndexOutOfBoundsException ex) { if (isJavaVersionAtMost(JAVA_10)) { assertEquals("100", ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Index 100 out of bounds for length 0", ex.getMessage(), "ex.getMessage()"); } assertEquals(0, ((ISOMsg) c).getDirection(), "(ISOMsg) c.getDirection()"); } }
public int unpack (ISOComponent c, byte[] b, int offset) throws ISOException { int len; BitSet bmap = ISOUtil.byte2BitSet (b, offset, false); c.setValue(bmap); len = (len=bmap.size()) > 128 ? 128 : len; return len >> 3; }
Base1_BITMAP126 extends ISOBitMapPackager { public int unpack (ISOComponent c, byte[] b, int offset) throws ISOException { int len; BitSet bmap = ISOUtil.byte2BitSet (b, offset, false); c.setValue(bmap); len = (len=bmap.size()) > 128 ? 128 : len; return len >> 3; } }
Base1_BITMAP126 extends ISOBitMapPackager { public int unpack (ISOComponent c, byte[] b, int offset) throws ISOException { int len; BitSet bmap = ISOUtil.byte2BitSet (b, offset, false); c.setValue(bmap); len = (len=bmap.size()) > 128 ? 128 : len; return len >> 3; } Base1_BITMAP126();  Base1_BITMAP126(int len, String description); }
Base1_BITMAP126 extends ISOBitMapPackager { public int unpack (ISOComponent c, byte[] b, int offset) throws ISOException { int len; BitSet bmap = ISOUtil.byte2BitSet (b, offset, false); c.setValue(bmap); len = (len=bmap.size()) > 128 ? 128 : len; return len >> 3; } Base1_BITMAP126();  Base1_BITMAP126(int len, String description); byte[] pack(ISOComponent c); int unpack(ISOComponent c, byte[] b, int offset); int getMaxPackedLength(); }
Base1_BITMAP126 extends ISOBitMapPackager { public int unpack (ISOComponent c, byte[] b, int offset) throws ISOException { int len; BitSet bmap = ISOUtil.byte2BitSet (b, offset, false); c.setValue(bmap); len = (len=bmap.size()) > 128 ? 128 : len; return len >> 3; } Base1_BITMAP126();  Base1_BITMAP126(int len, String description); byte[] pack(ISOComponent c); int unpack(ISOComponent c, byte[] b, int offset); int getMaxPackedLength();  }