6 Replies Latest reply: Feb 22, 2012 1:55 PM by Bluefairy RSS

    apdu buffer

    859967
      Hi,

      I am concerning how i should create APDU buffer array. I wonder if i should use native code to create (through native method t0InitAPDUBuffer()) or use Java with simple statment:
      buffer = new byte[261];
      I know it depends on JCRE implementer, but i would like to discuss with you the pros and cons of each solution.

      In my point of view, using native method will gain speed because we are creating a big array. And this is the only reason for using native method to do this task.

      Is it really really slow to create an array of 261 elements using java?

      thanks,

      Hoang Long
        • 1. Re: apdu buffer
          867670
          In my opinion, we should use native instead of Java, because not only APDU buffer, other initializations are also handled by native code. Thus, I just think simply that all the initialization like this should be done in one place, and it is native. We should not initialize APDU buffer only by Java while the rest is done by native code

          Edited by: Jason Gosling on Jul 24, 2011 9:52 PM
          • 2. Re: apdu buffer
            safarmer
            More importantly, you should use a transient array (in RAM) as you will use this buffer A LOT. EEPROM will be slow and will cause memory wear.

            Cheers,
            Shane
            • 3. Re: apdu buffer
              Mehmet
              Can you please give some more clue about how to initialize APDU on the computer code? It will be a BIG help for me!
              Thanks a lot in advance!
              Mehmet
              • 4. Re: apdu buffer
                safarmer
                Hi,
                Mehmet wrote:
                Can you please give some more clue about how to initialize APDU on the computer code? It will be a BIG help for me!
                You should start a new thread and reference this one if necessary. Also, you question is a little unclear. In the new thread you should explain what you are trying to achieve, what you have tried already and what the issue you are having is.

                Cheers,
                Shane
                • 5. Re: apdu buffer
                  Mehmet
                  Thanks for the tips. Already started two new threads. My aim is to be able to debug my applet.
                  • 6. Re: apdu buffer
                    Bluefairy
                    --

                    Edited by: Bluefairy on Feb 22, 2012 11:54 AM