Encode text bitmap in EBCDIC with forceStringEncoding=true #13

This commit is contained in:
Enrique Zamudio
2013-05-13 23:13:44 -05:00
parent 1787dfb0d5
commit 1ce67c621c
2 changed files with 16 additions and 2 deletions
@@ -328,7 +328,7 @@ public class MessageFactory<T extends IsoMessage> {
try {
final byte[] bitmapBuffer;
if (forceStringEncoding) {
byte[] _bb = HexCodec.hexDecode(new String(buf, isoHeaderLength+4, 16, encoding));
byte[] _bb = new String(buf, isoHeaderLength+4, 16, encoding).getBytes();
bitmapBuffer = new byte[36+isoHeaderLength];
System.arraycopy(_bb, 0, bitmapBuffer, 4+isoHeaderLength, 16);
} else {
@@ -358,7 +358,7 @@ public class MessageFactory<T extends IsoMessage> {
throw new ParseException("Insufficient length for secondary bitmap", minlength);
}
if (forceStringEncoding) {
byte[] _bb = HexCodec.hexDecode(new String(buf, isoHeaderLength+4, 16, encoding));
byte[] _bb = new String(buf, isoHeaderLength+4, 16, encoding).getBytes();
System.arraycopy(_bb, 0, bitmapBuffer, 20+isoHeaderLength, 16);
}
for (int i = isoHeaderLength + 20; i < isoHeaderLength + 36; i++) {