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.

How to send int

JavaCard Applet Development Related Questions and Answers.
Neqikoo
Posts: 7
Joined: Thu Feb 25, 2016 3:48 am
Points :74
Contact:

How to send int

Post by Neqikoo » Sun Jun 18, 2017 10:52 pm

In my applet, there are some int variable. And I want to send these int variable. But I don't know how. How can I send int variable?

I only know how to send bytes.

Code: Select all

private void mySend(APDU apdu) {
          byte[] buffer = apdu.getBuffer();     
          apdu.setOutgoing();
          short totalBytes = (short) out.length;
          apdu.setOutgoingLength(totalBytes);
          apdu.sendBytesLong(out, (short) 0, (short) out.length);
        }

Crawford
Posts: 39
Joined: Thu Sep 17, 2015 11:50 pm
Points :246
Contact:

Re: How to send int

Post by Crawford » Mon Jun 19, 2017 2:11 am

You can convert int to byte[] to solve your problem.
To convert an int to a byte array, keep in mind that an int is 4 bytes. Then this is a straight Java problem that is not specific to Java Card.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 23 guests

JavaCard OS : Disclaimer