@Test public void testUnpack() throws ISOException { ISOMsg m1 = new ISOMsg(); m1.setPackager(p); m1.unpack(PACKED); assertEquals("0800", m1.getMTI()); assertEquals("000000", m1.getString(3)); assertEquals("000001", m1.getString(11)); assertEquals("29110001", m1.getString(41)); assertArrayEquals(ISOUtil.hex2byte("55AA1122"), m1.getBytes(55)); assertEquals("Test 127.2", m1.getString("127.2")); assertEquals("Test 127.3", m1.getString("127.3")); assertEquals("Test 127.4", m1.getString("127.4")); assertEquals("Test 127.5.1", m1.getString("127.5.1")); }
@Override public int unpack(ISOComponent m, byte[] b) throws ISOException { ByteArrayInputStream bais = new ByteArrayInputStream(b); if (m instanceof Externalizable) { try { unpack (m, bais); } catch (IOException e) { throw new ISOException (e); } } return b.length - bais.available(); }
NativePackager implements ISOPackager { @Override public int unpack(ISOComponent m, byte[] b) throws ISOException { ByteArrayInputStream bais = new ByteArrayInputStream(b); if (m instanceof Externalizable) { try { unpack (m, bais); } catch (IOException e) { throw new ISOException (e); } } return b.length - bais.available(); } }
NativePackager implements ISOPackager { @Override public int unpack(ISOComponent m, byte[] b) throws ISOException { ByteArrayInputStream bais = new ByteArrayInputStream(b); if (m instanceof Externalizable) { try { unpack (m, bais); } catch (IOException e) { throw new ISOException (e); } } return b.length - bais.available(); }  }
NativePackager implements ISOPackager { @Override public int unpack(ISOComponent m, byte[] b) throws ISOException { ByteArrayInputStream bais = new ByteArrayInputStream(b); if (m instanceof Externalizable) { try { unpack (m, bais); } catch (IOException e) { throw new ISOException (e); } } return b.length - bais.available(); }  @Override byte[] pack(ISOComponent c); @Override int unpack(ISOComponent m, byte[] b); @Override void unpack(ISOComponent m, InputStream in); @Override String getDescription(); @Override String getFieldDescription(ISOComponent m, int fldNumber); @Override ISOMsg createISOMsg(); }
NativePackager implements ISOPackager { @Override public int unpack(ISOComponent m, byte[] b) throws ISOException { ByteArrayInputStream bais = new ByteArrayInputStream(b); if (m instanceof Externalizable) { try { unpack (m, bais); } catch (IOException e) { throw new ISOException (e); } } return b.length - bais.available(); }  @Override byte[] pack(ISOComponent c); @Override int unpack(ISOComponent m, byte[] b); @Override void unpack(ISOComponent m, InputStream in); @Override String getDescription(); @Override String getFieldDescription(ISOComponent m, int fldNumber); @Override ISOMsg createISOMsg();  }