Is there any way to get the EEPROM size of a Java Card?
-
- Posts: 3
- Joined: Sat Dec 15, 2018 9:35 am
- Points :40
- Contact:
Is there any way to get the EEPROM size of a Java Card?
Is there any way to get the EEPROM size of a Java Card?
Re: Is there any way to get the EEPROM size of a Java Card?
hello,
You can get it from the card supplier, or use the following API function to get.
You can get it from the card supplier, or use the following API function to get.
Code: Select all
/**
* Obtains the amount of memory of the specified type that is available to
* the applet. Note that implementation-dependent memory overhead structures
* may also use the same memory pool.
* <p>
* Notes:
* <ul>
* <li><em>The number of bytes returned is only an upper bound on the amount
* of memory available due to overhead requirements.</em>
* <li><em>Allocation of CLEAR_ON_RESET transient objects may affect the
* amount of CLEAR_ON_DESELECT transient memory available.</em>
* <li><em>Allocation of CLEAR_ON_DESELECT transient objects may affect the
* amount of CLEAR_ON_RESET transient memory available.</em>
* <li><em>If the number of available bytes is greater than 32767, then
* this method returns 32767.</em>
* <li><em>The returned count is not an indicator of the size of object which
* may be created since memory fragmentation is possible.</em>
* </ul>
*
* @param memoryType
* the type of memory being queried. One of the
* <CODE>MEMORY_TYPE_*</CODE> constants defined above. See
* {@link #MEMORY_TYPE_PERSISTENT MEMORY_TYPE_PERSISTENT}.
* @return the upper bound on available bytes of memory for the specified
* type
* @exception SystemException
* with the following reason codes:
* <ul>
* <li><code>SystemException.ILLEGAL_VALUE</code> if
* <code>memoryType</code> is not a valid memory type.
* </ul>
*/
public static short getAvailableMemory(byte memoryType)
throws SystemException {
Re: Is there any way to get the EEPROM size of a Java Card?
Note, the return value type of getAvailableMemory() is short. It max value 32767. If getAvailableMemory() returned 32767, you should called this method again to check wether the card has more memory.
-
- Posts: 3
- Joined: Sat Dec 15, 2018 9:35 am
- Points :40
- Contact:
Re: Is there any way to get the EEPROM size of a Java Card?
Can anyone share some code about getting the EEPROM?
thanks.
thanks.
Who is online
Users browsing this forum: No registered users and 87 guests