@Test public void testPack() throws Exception { ISOField field = new ISOField(12, "123"); IFA_LLBNUM packager = new IFA_LLBNUM(10, "Should be 0x30340123", true); TestUtils.assertEquals(new byte[]{0x30, 0x34, 0x01, 0x23}, packager.pack(field)); }
public byte[] pack (ISOComponent c) throws ISOException { String s = (String) c.getValue(); int len = s.length(); if (len > getLength() || len>99) throw new ISOException ( "invalid len "+len +" packing IFA_LLBNUM field " + c.getKey() ); byte[] b = new byte[2 + ((len+1) >> 1)]; prefixer.encodeLength(len + 1 >> 1 << 1, b); interpreter.interpret(s, b, 2); return b; }
IFA_LLBNUM extends ISOFieldPackager { public byte[] pack (ISOComponent c) throws ISOException { String s = (String) c.getValue(); int len = s.length(); if (len > getLength() || len>99) throw new ISOException ( "invalid len "+len +" packing IFA_LLBNUM field " + c.getKey() ); byte[] b = new byte[2 + ((len+1) >> 1)]; prefixer.encodeLength(len + 1 >> 1 << 1, b); interpreter.interpret(s, b, 2); return b; } }
IFA_LLBNUM extends ISOFieldPackager { public byte[] pack (ISOComponent c) throws ISOException { String s = (String) c.getValue(); int len = s.length(); if (len > getLength() || len>99) throw new ISOException ( "invalid len "+len +" packing IFA_LLBNUM field " + c.getKey() ); byte[] b = new byte[2 + ((len+1) >> 1)]; prefixer.encodeLength(len + 1 >> 1 << 1, b); interpreter.interpret(s, b, 2); return b; } IFA_LLBNUM();  IFA_LLBNUM(int len, String description, boolean pad); }
IFA_LLBNUM extends ISOFieldPackager { public byte[] pack (ISOComponent c) throws ISOException { String s = (String) c.getValue(); int len = s.length(); if (len > getLength() || len>99) throw new ISOException ( "invalid len "+len +" packing IFA_LLBNUM field " + c.getKey() ); byte[] b = new byte[2 + ((len+1) >> 1)]; prefixer.encodeLength(len + 1 >> 1 << 1, b); interpreter.interpret(s, b, 2); return b; } IFA_LLBNUM();  IFA_LLBNUM(int len, String description, boolean pad); void setPad(boolean pad); byte[] pack(ISOComponent c); int unpack(ISOComponent c, byte[] b, int offset); void unpack(ISOComponent c, InputStream in); int getMaxPackedLength(); }
IFA_LLBNUM extends ISOFieldPackager { public byte[] pack (ISOComponent c) throws ISOException { String s = (String) c.getValue(); int len = s.length(); if (len > getLength() || len>99) throw new ISOException ( "invalid len "+len +" packing IFA_LLBNUM field " + c.getKey() ); byte[] b = new byte[2 + ((len+1) >> 1)]; prefixer.encodeLength(len + 1 >> 1 << 1, b); interpreter.interpret(s, b, 2); return b; } IFA_LLBNUM();  IFA_LLBNUM(int len, String description, boolean pad); void setPad(boolean pad); byte[] pack(ISOComponent c); int unpack(ISOComponent c, byte[] b, int offset); void unpack(ISOComponent c, InputStream in); int getMaxPackedLength();  }