byte[] b = ISOUtil.hex2byte(data);
char c1= (char) b[0];
char c2= (char) b[1];
String x = ""+c1+c2;
int bitmap = Integer.parseInt(x,16);
BitSet bitmapBitSet = new BitSet(8);
String Field63[] = new String[8];
for (int i = 0; i < 8; i++) {
if (((bitmap & (0x80 >> i)) > 0)) {
bitmapBitSet.set(i);
}
}
int offset = 2;
for (int i = 0; i < 8; i++) {
if (bitmapBitSet.get(i)) {
int y = i + 2;
switch (y) {
case 2: {
byte[] temp = new byte[6];
System.arraycopy(b, offset, temp, 0, 6);
Field63[y] = new String(temp);
offset += 6;
}
break;
case 3: {
int size = 3;
byte[] temp = new byte[size];
System.arraycopy(b, offset, temp, 0, size);
Field63[y] = new String(temp);
offset += size;
}
break;
case 4: {
int size = 3;
byte[] temp = new byte[size];
System.arraycopy(b, offset, temp, 0, size);
Field63[y] = new String(temp);
offset += size;
}
break;
case 5: {
int size = 6;
byte[] temp = new byte[size];
System.arraycopy(b, offset, temp, 0, size);
Field63[y] = new String(temp);
offset += size;
}
break;
case 6: {
int size = 2;
byte[] temp = new byte[size];
System.arraycopy(b, offset, temp, 0, size);
Field63[y] = new String(temp);
offset += size;
}
break;
case 7: {
int size = 5;
byte[] temp = new byte[size];
System.arraycopy(b, offset, temp, 0, size);
Field63[y] = new String(temp);
offset += size;
}
break;
default:
break;
}
}
} -chhil
Mark,
I am working on a custom bitmap packager to handle the fixed size bitmap that treats the most significant bit of the bitmap as a position of an element and not an indication of an extended bitmap.
A custom subfield packager will be needed to handle field positions based on the bitmap starting from the first location in the bitmap.
-chhil
On 05/03/2013 13:00, chillum wrote:
> I cant seem to figure out if I can use a standard bitmap packager for a
> subfield 63 in an ISOMsg.
I think you will need a specific SubfieldPackager to handle this special
bitmap?
>
> Currently I am treating the field as IFA_LLLBINARY in my packager and
> parsing the bitmap and fields out manually.
>
> The data comes in as "4230313233343536414141363534333231"
> The bitmap part is 4230
> For interpreting it , it becomes a B0 ( B=0x42 and 0 =0x30)
> So binary form is 1011 0000
Is the BitMap always just a single byte (once interpreted)? I wonder if
it is variable length at all?
--
Mark
--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage.
Please support jPOS, contact: sa...@jpos.org
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
<isofieldpackager
id="63"
length="255"
name="PRIVATE USE"
class="org.jpos.iso.IFB_LLHBINARY"
packager="org.jpos.iso.packager.Base1SubFieldPackager">
<isofield
id="0"
length="3"
name="BITMAP"
class="org.jpos.iso.IFB_BITMAP"/>
<isofield
id="1"
length="4"
pad="true"
name="NETWORK ID"
class="org.jpos.iso.IFB_NUMERIC"/>
<isofield
id="2"
length="4"
name="TIME LIMIT"
class="org.jpos.iso.IFB_NUMERIC"/>
...
...
--
Mark
yes, I think you can't get away from a custom bitmap packager, hopefully the bitmap related helpers in ISOUtil will come handy.