I wonder if anyone knows exactly where is temp array stored (EEPROM or RAM) in the following Java Card method (part of source code of WalletDemoApplet I have found inside JCIDE samples directory) . Please note that the array is not allocated by means of makeTransientByteArray. Also it is declared as a local variable inside a method.
private void calIntegral(byte [] buf,byte soff,short len)
{
byte temp[]={0x00,0x00,0x00,0x00};
short low=0;
byte aa=0;
if (len==2)
Util.arrayCopy(buf, soff, temp,(short)2, len);
else
Util.arrayCopy(buf, soff, temp,(short)0, len);
...
}
Also, in the Java Card Applet Developer's Guide, you can find:
The Converter ensures that memory is allocated for the contents of static fields, namely, primitive data types and references to arrays. Memory is allocated for instances by using the new bytecode from the system heap and cannot be reclaimed (unless the smart card implements a garbage collector). Memory for method variables, locals, and parameters is allocated from the stack and is reclaimed when the method returns.