fix #36 LLLLVAR + LLLLBIN

This commit is contained in:
Enrique Zamudio
2015-02-19 19:40:03 -06:00
parent 576dc50b44
commit 00c046881b
9 changed files with 270 additions and 37 deletions
@@ -341,8 +341,7 @@ public class IsoMessage {
return bs;
}
/** This calls writeInternal(), allowing applications to get the byte buffer containing the
* message data, without the length header. */
/** Writes the message to a memory stream and returns a byte array with the result. */
public byte[] writeData() {
ByteArrayOutputStream bout = new ByteArrayOutputStream();
if (isoHeader != null) {
@@ -461,6 +460,8 @@ public class IsoMessage {
sb.append(String.format("%02d", desc.length()));
} else if (v.getType() == IsoType.LLLBIN || v.getType() == IsoType.LLLVAR) {
sb.append(String.format("%03d", desc.length()));
} else if (v.getType() == IsoType.LLLLBIN || v.getType() == IsoType.LLLLVAR) {
sb.append(String.format("%04d", desc.length()));
}
sb.append(desc);
}