How can I read Extended APDU input to the same buffer

The following is the code I am currently using where inBuffer is an intermediate array of 1000 length. However, I do not want to allocate any buffers at all, and just want to send a command apdu of 1000 byte length and modify it in the code and return the modified buf in the response APDU.
// Read extended APDU input
byte[] buf = apdu.getBuffer();
short bytesRead = apdu.setIncomingAndReceive();
short dataOffset = apdu.getOffsetCdata();
// store first chunk in our intermediate byte array <-- how do i get rid of the intermediate array
Util.arrayCopyNonAtomic(buf, dataOffset, inBuffer, (short) 0, bytesRead);
// what is the overall length?
short overallLength = apdu.getIncomingLength();
short messageOffset = bytesRead;
if (bytesRead != overallLength){ // otherwise we're finished, all bytes received
     short received = 0;
     do{
               received = apdu.receiveBytes((short)0);
               Util.arrayCopyNonAtomic(buf, (short)0, inBuffer, messageOffset, received);
               messageOffset  += received;
          } while(received != 0);
* REST OF CODE IN PROCESS METHOD
I have also tried replacing the above code with the following
short bytesLeft = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);
if (bytesLeft < (short)55) ISOException.throwIt( ISO7816.SW_WRONG_LENGTH );
short readCount = apdu.setIncomingAndReceive();
while ( bytesLeft > 0){
  // process bytes in buffer[5] to buffer[readCount+4];
  bytesLeft -= readCount;
  readCount = apdu.receiveBytes ( ISO7816.OFFSET_CDATA );
as shown in the javadocs API, but it does not compile.
This is my command APDU:
/send 800100000003E8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003E8
As you can see:
CLA - 80
INS - 01
P1 & P2 - 00
LC - 0003E8
Data - 1000 0s
LE - 03E8
I am using JavaCard 3.0 with JCOP in Eclipse. How can I read the extended length apdu to the same buffer? I have no problem in returning an extended length response APDU. Thanks a lot for the help.

You should not call the convenience method setIncomingAndReceive() in your first code. Please find out about the different APDU states. Furthermore, your Applet should implement the ExtendedLength tagging interface.

Similar Messages

  • How can I make my user input on the same line as the question?

    The only way I know of doing it is
    System.out.println ("Please enter an uppercase letter of the English Alphabet: ");
              letter = dataIn.readLine ();But that makes Please enter an uppercase letter of the English Alphabet:
    **User input here, a line down**So how can I make it all fit into one line with this sort of layout:
    Please enter an uppercase letter of the English Alphabet:  **USER INPUTS HERE, SAME LINE**

    change your call from println to print.
    check the API docs for this stuff, it tells you everything you need to know.
    Good Luck
    Lee

  • How can install a second app icon  of the same on app on a different home screen?

    how can install a second app icon  of the same on app on a different home screen?
    for example i have the phot app on one home screen and the i want the same photo app showing on the other home screens?
    I want to have a duplicate app on on more than one home screen
    Another example if i have the Evernote app showing on my first home screen and then my last home screen as well

    Put it in the dock at the bottom. Apps put there stay there and show at the bottom of all home screens.

  • Hi, we have two iphones with two accounts.  The apple tv automatically syncs with one account to play music from the iphone to apple tv.  How can I use my iphone to do the same?

    Hi, we have two iphones with two accounts.  The apple tv automatically syncs with one account to play music from the iphone to apple tv.  How can I use my iphone to do the same?

    Our experience is a little different, we have different iTunes accounts for different family members, each family member has their own iTunes library on their own mac, each mac uses my Apple ID for homesharing and we are able to play purchased content from each library on the Apple TV.

  • How can I set up two iPhones with the same contact, photos, music etc... but a different sim card and phone number. They will both be my phones, but one will be for use in other countries.

    How can I set up two iPhones with the same contact, photos, music etc... but a different sim card and phone number. They will both be my phones, but one will be for use in other countries.

    Phone A = phone with information you want duplicated
    Phone B = phone that you want to copy from A
    Backup Phone A.
    Wipe Phone B using these instructions. What to do before selling or giving away your iPhone, iPad, or iPod touch - Apple Support
    Phone B should be on the 'Hello' screen. Do not swipe it. Launch iTunes. Plug in Phone B.
    When iTunes asks if you want to set up as new phone or restore from backup, choose restore from backup of Phone A.
    After this setup, any changes to one phone (i.e. adding a contact, downloading an app) will have to be manually duplicated on the second phone, if that is your desire). Making changes to one phone will not affect the other after setup.

  • How can I have another Itunes account on the same computer for my wife?

    How can I have another Itunes account on the same computer for my wife?

    In case you didn't fully understand what dallon meant, it means another user account on your computer. You set that up in Windows and then instal iTunes onto that account.
    That way, you each have your own desktop and your own itunes. You can link to the songs in the other person's library as well, but you cannot run both iTunes at the same time. (That simply means you need to close it on the first account before opening it on the second account.)

  • My apple id is different to my icloud id how can i change my icloud id to the same as my apple id

    My apple id is different to my icloud id how can i change my icloud id to the same as my apple id

    Delete the iCloud Account
    I mean Delete Account on your iPad iPhone.

  • How can I start a new paragraph within the same table cell?

    In Numbers, when adding text within a table frame, how can I start a new line within the same frame (rather than advancing to the next cell)?  I'd like to enter a mini-list of several items of various lengths of data.

    While Wayne's answer solves your problem, another possibility is to uncheck the box at the bottom of the Table inspector for "Return key moves to next cell." If that is unchecked, the return key types a paragraph return within the cell (the same as Option Return with the box checked).
    With that box unchecked, Shift Return types a soft return (new line without a paragraph break).

  • How can I run 2 Dreamweaver windows at the same time?

    How can I run 2 Dreamweaver windows at the same time on my
    PC?
    basically I have 2 monitors and I want to edit CSS on one
    monitor and have the html page open on the other so I can quickly
    look from one to another with in a split second instead of taking
    that extra time to switch back and forth using the tabs at the top,
    I know I should probably invest into a mac so i can work out side
    of the Dreamweaver application window and I will in the future but
    is there any way i can do this on my windows XP pro PC?
    Thank you
    Maurice

    Open the CSS in DW, and use F10 to open the Code Inspector.
    Place the
    latter as needed.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Random_Yggdrasil" <[email protected]> wrote
    in message
    news:gi2htb$j4j$[email protected]..
    > How can I run 2 Dreamweaver windows at the same time on
    my PC?
    > basically I have 2 monitors and I want to edit CSS on
    one monitor and have
    > the
    > html page open on the other so I can quickly look from
    one to another with
    > in a
    > split second instead of taking that extra time to switch
    back and forth
    > using
    > the tabs at the top, I know I should probably invest
    into a mac so i can
    > work
    > out side of the Dreamweaver application window and I
    will in the future
    > but is
    > there any way i can do this on my windows XP pro PC?
    >
    > Thank you
    > Maurice
    >
    >
    >

  • How can I get iCal not to show the same birthday dates from my iCloud

    How can I get iCal not to show the same birthday dates from my iCloud?

    You don't need them stored locally for a backup. You can manually export your contacts as archive for backup. Also, if you are backing up with Time Machine, you already have a backup. If your hard drive crashed, you would have to rely on your backup or iCloud anyway.
    So, if you're comfortable with that, sign out of iCloud. Choose to delete contacts from the computer. When you sign back into iCloud, you should only have iCloud contacts listed in AB. When you open iCal, you should only have one listing for birthdays.
    The other alternative is to disable the Birthday c.alendar and create one manually.

  • How can I import photos inro Organiser in the same order as they are in my files?

    How can I import photos into Organiser in the same order as they are in my files?

    You can do a change to your files you want to import so they are in order that your version of PSE uses.
    One of the benefits of PSE is that you are no longer limited to specific order or locations of pictures. If you want a spefic order for display purposes create an album and your order will be maintained in the album. Other than that I keep my display on Newest first(I have PSE 11) and rarely change it.

  • How can I have two PDFs open at the same time next to each other?

    How can I have two PDFs open at the same time next to each other?

    Moved to Adobe Reader for iOS.
    The only way I know how to do that is with two iPads.

  • How can i find my lose iphone with the same apple id i use now

    how can i find my lose iphone with the same apple id i use now

    If you set it up on your iPhone before you lost it then you can sign into your iCloud account on a computer and attempt to locate it.

  • How can i create multiple accounts but use the same itunes?

    how can i create multiple accounts but use the same itunes?

    Hi iCloud is Making Me Go Crazy,
    You will need to create a new Apple ID for your GameCenter and iCloud services.  You can continue to use the current Apple ID you share with your Mom for access to iTunes Store purchases if you wish. 
    Using your Apple ID for Apple services
    http://support.apple.com/kb/HT4895
    Frequently asked questions about Apple ID
    http://support.apple.com/kb/HT5622
    Cheers,
    - Judy

  • I am uploading receipts using the PURCHASE_ORDER_RECEIPT EIP.  When I upload serialized assets each one is processed as a separate receipt (receiver_id). How can I have these all aggregated on the same receipt?

    I am uploading receipts using the PURCHASE_ORDER_RECEIPT EIP.  When I upload serialized assets each one is processed as a separate receipt (receiver_id). How can I have these all aggregated on the same receipt?
    Is there a parameter I should be using in the XML or is there a setting in Peoplesoft that will accomplish this?
    Jim

    sundy.liu wrote:
    Unfortunately however, even with the TCP tweaks enabled, I still only get a little over 1 Gb/s through the two aggregated Gig ports. It seems as though the aggregation is only using one port, though MRTG graphs of the two switch ports do in fact show that they are both being utilized equally, essentially splitting the 1 Gb/s speed between
    the two ports.
    Problem with the server? switch? Aggregation software? All the above? At any rate, I seem to be missing something.. Any help regarding this issue would be greatly appreciated!If you're only running a single stream, that's all you'll see. Teaming/aggregating doesn't make one stream go faster.
    If you ran two streams simultaneously, then you should see a difference between a single 1G interface and an aggregate of two 1G interfaces.
    Darren

Maybe you are looking for

  • Goods confirmation workflow is awaiting for approval

    Hi Gurus, while confirm the goods/service when try to check the document i am getting a message as the document is free from errors but when i click on confirm the history is showing as " waiting for approval" but when i go to item details and click

  • Please Help me with this Logic.....

    Seniors , Please Help me with this Requirment      BUKRS _____________________      GJAHR  ____________________      LIFNR    _____________________      MONAT _____________________ LIFNR  NAME1  GSBER   GJAHR  HBAL SBAL  ACCUMBAL 1001   ABB    BUSS1 

  • NO_MAPPINGPROGRAM_FOUND in SOAP to ABAP_PROXY scenar

    Hi everybody. I have read many threads regarding the NO_MAPPINGPROGRAM_FOUND issue but did not find an answer. I have created a web service as an abap proxy on sap hcm system using the outside-in method. now i want to call this web service over xi so

  • Docked resolution problem x220

    Hi All Sometimes after redocking resolution on external screen doesn't change to one set in  Intel graphics and media panel. My system Lenovo x220 docking station 3 OS Windows XP SP3. I have more the same systems and they don't have this problem. I u

  • Export of development objects

    Hello everybody, I need some help with my SAP BW 3.1 WAS 6.20. I would like to export a development object with all the contained elements into a file so that I can import this development object into another SAP system. I have searched the SAP help