Our Online Store have the new products: RFID antenna board. Currently it can work with JC10M24R and JCOP4 card chips.
Compared with normal cards, the antenna board module has a smaller size and fixed holes, which is easy to integrate in the IOT(Internet Of Things) project.

counter for byte array

JavaCard Applet Development Related Questions and Answers.
shameem
Posts: 7
Joined: Sat May 05, 2018 1:26 am
Points :162
Location: bangalore
Contact:

counter for byte array

Post by shameem » Mon Oct 08, 2018 2:02 am

hi everyone, Please help me.

if i have a 3 or more bytes of array. then how would i increment the counter to reach to the last value stored in that array.

Thanks and regard
Shameem Ahamad

BirdKing
Posts: 86
Joined: Wed Nov 04, 2015 7:23 am
Points :656
Contact:

Re: counter for byte array

Post by BirdKing » Fri Oct 12, 2018 4:00 am

In JavaCard applet, you can do like this:

Code: Select all

case (byte)0x02:
            byte temp[] = new byte[(short)20];
            temp[(short)(temp.length -1)] = (byte)0x66;
            Util.setShort(buf, (short)0, (short)temp.length);
            Util.arrayCopy(temp, (short)0, buf, (short)2, (short)temp.length);
            apdu.setOutgoingAndSend((short)0, (short)(2 + temp.length));
            break;

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 42 guests

JavaCard OS : Disclaimer