JavacardOS will not accept order any more, please contact our partner Feitian online Store:
https://ftsafe.en.alibaba.com/index.html

sendBytesLong()

JavaCard Applet Development Related Questions and Answers.
Heerden
Posts: 11
Joined: Tue Dec 29, 2015 5:14 am
Points :87
Contact:

sendBytesLong()

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 sendBytesLong

public 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.


User avatar
mabel
Posts: 237
Joined: Mon May 18, 2015 3:09 am
Points :1705
Contact:

Re: sendBytesLong()

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:

Re: sendBytesLong()

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

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: Google [Bot] and 79 guests

JavaCard OS : Disclaimer