JavaCard Applet Development Related Questions and Answers.
-
Heerden
- Posts: 11
- Joined: Tue Dec 29, 2015 5:14 am
- Points :87
-
Contact:
Post
by Heerden » Thu Jun 30, 2016 4:20 am
In the introduction of APDU in Java card API document, it shows "For sending large byte arrays as response data, the APDU class provides a special method sendBytesLong() which manages the APDU buffer." But how does it help to send large byte arrays? Why is this method to manage the APDU buffer? I can not see any useful information.
Here is the description of
sendBytesLongpublic void sendBytesLong(byte[] outData,
short bOff,
short len)
throws APDUException,
SecurityException
Sends len more bytes from outData byte array starting at specified offset bOff.
If the last of the response is being sent by the invocation of this method, the APDU buffer must not be altered. If the data is altered, incorrect output may be sent to the CAD. Requiring that the buffer not be altered allows the implementation to reduce protocol overhead by transmitting the last part of the response along with the status bytes.
The Java Card runtime environment may use the APDU buffer to send data to the CAD.
-
mabel
- Posts: 237
- Joined: Mon May 18, 2015 3:09 am
- Points :1705
-
Contact:
Post
by mabel » Fri Jul 01, 2016 5:01 am
If you have a buffer that is larger than the APDU buffer, you can directly send from that buffer. But you still have the same restrictions on data length that can be sent in one APDU response but you do not need to copy into the APDU buffer for each response. You still need to use APDU response chaining to send more data than you card supports.
-
Tarantino
- Posts: 101
- Joined: Wed Aug 19, 2015 1:56 am
- Points :478
-
Contact:
Post
by Tarantino » Fri Jul 01, 2016 5:55 am
The method "sendBytesLong(...)" is to send data in working buffer larger than APDU buffer.
The greatest glory in living lies not in never falling, but in rising every time we fall.--Nelson Mandela
Users browsing this forum: Bing [Bot], Google [Bot] and 18 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.