@Test public void testUnpack() throws Exception { byte[] raw = new byte[] {0x02, 0x12, 0x34, 0x00, 0x00}; IFB_LLHFBINARY packager = new IFB_LLHFBINARY(4, "Should be 1234"); ISOBinaryField field = new ISOBinaryField(12); packager.unpack(field, raw, 0); TestUtils.assertEquals(new byte[] {0x12, 0x34}, (byte[])field.getValue()); }
public int unpack (ISOComponent c, byte[] b, int offset) throws ISOException { int len = b[offset] & 0xFF; byte[] value = new byte[len]; System.arraycopy(b, ++offset, value, 0, len); c.setValue (value); return getLength()+1; }
IFB_LLHFBINARY extends ISOFieldPackager { public int unpack (ISOComponent c, byte[] b, int offset) throws ISOException { int len = b[offset] & 0xFF; byte[] value = new byte[len]; System.arraycopy(b, ++offset, value, 0, len); c.setValue (value); return getLength()+1; } }
IFB_LLHFBINARY extends ISOFieldPackager { public int unpack (ISOComponent c, byte[] b, int offset) throws ISOException { int len = b[offset] & 0xFF; byte[] value = new byte[len]; System.arraycopy(b, ++offset, value, 0, len); c.setValue (value); return getLength()+1; } IFB_LLHFBINARY();  IFB_LLHFBINARY(int len, String description); }
IFB_LLHFBINARY extends ISOFieldPackager { public int unpack (ISOComponent c, byte[] b, int offset) throws ISOException { int len = b[offset] & 0xFF; byte[] value = new byte[len]; System.arraycopy(b, ++offset, value, 0, len); c.setValue (value); return getLength()+1; } IFB_LLHFBINARY();  IFB_LLHFBINARY(int len, String description); byte[] pack(ISOComponent c); int unpack(ISOComponent c, byte[] b, int offset); void unpack(ISOComponent c, InputStream in); ISOComponent createComponent(int fieldNumber); int getMaxPackedLength(); }
IFB_LLHFBINARY extends ISOFieldPackager { public int unpack (ISOComponent c, byte[] b, int offset) throws ISOException { int len = b[offset] & 0xFF; byte[] value = new byte[len]; System.arraycopy(b, ++offset, value, 0, len); c.setValue (value); return getLength()+1; } IFB_LLHFBINARY();  IFB_LLHFBINARY(int len, String description); byte[] pack(ISOComponent c); int unpack(ISOComponent c, byte[] b, int offset); void unpack(ISOComponent c, InputStream in); ISOComponent createComponent(int fieldNumber); int getMaxPackedLength();  }