@Test public void testGetTLVEmptyValue1() { byte[] value = new byte[0]; byte[] result = tl.createTLVMsg(TEST_TAG1, value).getTLV(); assertArrayEquals(ISOUtil.hex2byte("6400"), result); }
public byte[] getTLV() { String hexTag = Integer.toHexString(tag); byte[] bTag = ISOUtil.hex2byte(hexTag); if (tagSize > 0) bTag = fitInArray(bTag, tagSize); byte[] bLen = getL(); byte[] bVal = getValue(); if (bVal == null) bVal = new byte[0]; int tLength = bTag.length + bLen.length + bVal.length; byte[] out = new byte[tLength]; System.arraycopy(bTag, 0, out, 0, bTag.length); System.arraycopy(bLen, 0, out, bTag.length, bLen.length); System.arraycopy(bVal, 0, out, bTag.length + bLen.length, bVal.length ); return out; }
TLVMsg implements Loggeable { public byte[] getTLV() { String hexTag = Integer.toHexString(tag); byte[] bTag = ISOUtil.hex2byte(hexTag); if (tagSize > 0) bTag = fitInArray(bTag, tagSize); byte[] bLen = getL(); byte[] bVal = getValue(); if (bVal == null) bVal = new byte[0]; int tLength = bTag.length + bLen.length + bVal.length; byte[] out = new byte[tLength]; System.arraycopy(bTag, 0, out, 0, bTag.length); System.arraycopy(bLen, 0, out, bTag.length, bLen.length); System.arraycopy(bVal, 0, out, bTag.length + bLen.length, bVal.length ); return out; } }
TLVMsg implements Loggeable { public byte[] getTLV() { String hexTag = Integer.toHexString(tag); byte[] bTag = ISOUtil.hex2byte(hexTag); if (tagSize > 0) bTag = fitInArray(bTag, tagSize); byte[] bLen = getL(); byte[] bVal = getValue(); if (bVal == null) bVal = new byte[0]; int tLength = bTag.length + bLen.length + bVal.length; byte[] out = new byte[tLength]; System.arraycopy(bTag, 0, out, 0, bTag.length); System.arraycopy(bLen, 0, out, bTag.length, bLen.length); System.arraycopy(bVal, 0, out, bTag.length + bLen.length, bVal.length ); return out; } @Deprecated  TLVMsg(int tag, byte[] value); protected  TLVMsg(int tag, byte[] value, int tagSize, int lengthSize); }
TLVMsg implements Loggeable { public byte[] getTLV() { String hexTag = Integer.toHexString(tag); byte[] bTag = ISOUtil.hex2byte(hexTag); if (tagSize > 0) bTag = fitInArray(bTag, tagSize); byte[] bLen = getL(); byte[] bVal = getValue(); if (bVal == null) bVal = new byte[0]; int tLength = bTag.length + bLen.length + bVal.length; byte[] out = new byte[tLength]; System.arraycopy(bTag, 0, out, 0, bTag.length); System.arraycopy(bLen, 0, out, bTag.length, bLen.length); System.arraycopy(bVal, 0, out, bTag.length + bLen.length, bVal.length ); return out; } @Deprecated  TLVMsg(int tag, byte[] value); protected  TLVMsg(int tag, byte[] value, int tagSize, int lengthSize); int getTag(); byte[] getValue(); byte[] getTLV(); byte[] getL(); String getStringValue(); @Override String toString(); @Override void dump(PrintStream p, String indent); }
TLVMsg implements Loggeable { public byte[] getTLV() { String hexTag = Integer.toHexString(tag); byte[] bTag = ISOUtil.hex2byte(hexTag); if (tagSize > 0) bTag = fitInArray(bTag, tagSize); byte[] bLen = getL(); byte[] bVal = getValue(); if (bVal == null) bVal = new byte[0]; int tLength = bTag.length + bLen.length + bVal.length; byte[] out = new byte[tLength]; System.arraycopy(bTag, 0, out, 0, bTag.length); System.arraycopy(bLen, 0, out, bTag.length, bLen.length); System.arraycopy(bVal, 0, out, bTag.length + bLen.length, bVal.length ); return out; } @Deprecated  TLVMsg(int tag, byte[] value); protected  TLVMsg(int tag, byte[] value, int tagSize, int lengthSize); int getTag(); byte[] getValue(); byte[] getTLV(); byte[] getL(); String getStringValue(); @Override String toString(); @Override void dump(PrintStream p, String indent);  }