Monday, December 3, 2001 01:13 AM
Could you be more specific, please ? Why do you need transient arrays to access your filesystem ?
Is it absolutely necessary for you to use transient data ?
While waiting for your input, here is a little clarification on what transient data is.
It's a common misconception to think that there are transient objects in JavaCard.
There are transient arrays, not transient objects.
In the case of a transient object array, you create an array of transient references to persistent objects.
The objects are not transient, but their references will be.
Let's review the following code :
byte transientArray = JCSystem.makeTransientObjectArray((short) 5, JCSystem.CLEAR_ON_DESELECT);
transientArray = new OwnerPIN((byte)3, (byte)5);
I have created an array that can contain 5 transient references that will be cleared on applet deselection.
Then, I create a persistent OwnerPIN object (anything created by new() is persistent), and store the reference in the transient array.
From the memory point of view :
- the reference 'transientArray' is stored in EEPROM
- the contents of 'transientArray' are stored in RAM
- the reference of the OwnerPIN object is stored in RAM
- the contents of the OwnerPIN object are stored in EEPROM
Now, if the applet is deselected, the reference will be lost and the OwnerPIN object will become unreachable unless I save the reference somewhere else in persistent data.
I must insist on the fact that it's not possible to create a transient object, just arrays of transient references.