@Test public void testGetData() throws Exception { for (byte ton : TONS) { for (byte npi : NPIS) { for (int len = 1; len <= MAX_ADDRESS_LENGTH; len++) { String a = address(len); address = new Address(ton, npi, a, len + 1); ByteBuffer buffer = address.getData(); assertEquals(ton, buffer.removeByte()); assertEquals(npi, buffer.removeByte()); assertEquals(a, buffer.removeCString()); } } } }
public ByteBuffer getData() { ByteBuffer addressBuf = new ByteBuffer(); addressBuf.appendByte(getTon()); addressBuf.appendByte(getNpi()); try { addressBuf.appendCString(getAddress(), Data.ENC_ASCII); } catch(UnsupportedEncodingException e) { } return addressBuf; }
Address extends ByteData { public ByteBuffer getData() { ByteBuffer addressBuf = new ByteBuffer(); addressBuf.appendByte(getTon()); addressBuf.appendByte(getNpi()); try { addressBuf.appendCString(getAddress(), Data.ENC_ASCII); } catch(UnsupportedEncodingException e) { } return addressBuf; } }
Address extends ByteData { public ByteBuffer getData() { ByteBuffer addressBuf = new ByteBuffer(); addressBuf.appendByte(getTon()); addressBuf.appendByte(getNpi()); try { addressBuf.appendCString(getAddress(), Data.ENC_ASCII); } catch(UnsupportedEncodingException e) { } return addressBuf; } Address();  Address(int maxAddressLength);  Address(byte ton, byte npi, int maxAddressLength);  Address(String address);  Address(String address, int maxAddressLength);  Address(byte ton, byte npi, String address);  Address(byte ton, byte npi, String address, int maxAddressLength); }
Address extends ByteData { public ByteBuffer getData() { ByteBuffer addressBuf = new ByteBuffer(); addressBuf.appendByte(getTon()); addressBuf.appendByte(getNpi()); try { addressBuf.appendCString(getAddress(), Data.ENC_ASCII); } catch(UnsupportedEncodingException e) { } return addressBuf; } Address();  Address(int maxAddressLength);  Address(byte ton, byte npi, int maxAddressLength);  Address(String address);  Address(String address, int maxAddressLength);  Address(byte ton, byte npi, String address);  Address(byte ton, byte npi, String address, int maxAddressLength); void setData(ByteBuffer buffer); ByteBuffer getData(); void setTon(byte ton); void setNpi(byte npi); void setAddress(String address); void setAddress(String address, int maxAddressLength); byte getTon(); byte getNpi(); String getAddress(); String getAddress(String encoding); String debugString(); }
Address extends ByteData { public ByteBuffer getData() { ByteBuffer addressBuf = new ByteBuffer(); addressBuf.appendByte(getTon()); addressBuf.appendByte(getNpi()); try { addressBuf.appendCString(getAddress(), Data.ENC_ASCII); } catch(UnsupportedEncodingException e) { } return addressBuf; } Address();  Address(int maxAddressLength);  Address(byte ton, byte npi, int maxAddressLength);  Address(String address);  Address(String address, int maxAddressLength);  Address(byte ton, byte npi, String address);  Address(byte ton, byte npi, String address, int maxAddressLength); void setData(ByteBuffer buffer); ByteBuffer getData(); void setTon(byte ton); void setNpi(byte npi); void setAddress(String address); void setAddress(String address, int maxAddressLength); byte getTon(); byte getNpi(); String getAddress(); String getAddress(String encoding); String debugString();  }