JavaCard Applet Development Related Questions and Answers.
-
Neqikoo
- Posts: 7
- Joined: Thu Feb 25, 2016 3:48 am
- Points :74
-
Contact:
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:
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.
Users browsing this forum: Google [Bot] and 29 guests
JavaCard OS : Disclaimer
Board Disclaimer
The views and comments posted in these fora are personal and do not necessarily represent the those of the Management of JavaCard OS.
The Management of JavaCard OS does not, under any circumstances whatsoever, accept any responsibility for any advice, or recommentations, made by, or implied by, any member or guest vistor of JavaCard OS that results in any loss whatsoever in any manner to a member of JavaCard OS, or to any other person.
Furthermore, the Management of JavaCard OS is not, and cannot be, responsible for the content of any other Internet site(s) that have been linked to from JavaCard OS.