javacard.framework.SystemException Java Examples

The following examples show how to use javacard.framework.SystemException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TransmitManager.java    From GidsApplet with GNU General Public License v3.0 5 votes vote down vote up
public short doChainingOrExtAPDUFlash(APDU apdu) throws ISOException {
    // allocate flash buffer only when needed - it can remain for the rest of the card life
    if (flash_buf == null)
    {
        try {
            flash_buf = new byte[FLASH_BUF_SIZE];
        } catch(SystemException e) {
            if(e.getReason() == SystemException.NO_RESOURCE) {
                ISOException.throwIt(ISO7816.SW_FILE_FULL);
            }
            ISOException.throwIt(ISO7816.SW_UNKNOWN);
        }
    }
    return doChainingOrExtAPDUWithBuffer(apdu, flash_buf, FLASH_BUF_SIZE);
}