Fix debugString for variable-length fields

This commit is contained in:
Enrique Zamudio
2013-06-25 12:37:41 -05:00
parent 6bdd26fadf
commit 61fded16d2
2 changed files with 11 additions and 1 deletions
@@ -453,7 +453,13 @@ public class IsoMessage {
for (int i = 2; i < 129; i++) {
IsoValue<?> v = fields[i];
if (v != null) {
sb.append(v);
String desc = v.toString();
if (v.getType() == IsoType.LLBIN || v.getType() == IsoType.LLVAR) {
sb.append(String.format("%02d", desc.length()));
} else if (v.getType() == IsoType.LLLBIN || v.getType() == IsoType.LLLVAR) {
sb.append(String.format("%03d", desc.length()));
}
sb.append(desc);
}
}
return sb.toString();