Page 1 of 1

How to understand java card atomic?

Posted: Thu Feb 07, 2019 11:12 am
by sandbox
How to understand java card atomic?Could anybody give a detail instance to explain?

Re: How to understand java card atomic?

Posted: Fri Feb 15, 2019 7:48 pm
by kuafu
https://www.javacardos.com/wiki/javacar ... es/storage

Code: Select all

JCSystem.beginTransaction();
            //Copies an array from the 'buf' source array, beginning at the ISO7816.OFFSET_CDATA position(non-atomically).
            Util.arrayCopyNonAtomic(buf, ISO7816.OFFSET_CDATA, tmpMemory, (short)0, lc);
            //Copies an array from the 'tmpMemory' source array, beginning at the 0 position
            Util.arrayCopy(tmpMemory, (short)0, buf, (short)0, lc);
            //Commits an atomic transaction. The contents of commit buffer is atomically committed. 
            JCSystem.commitTransaction();
            apdu.setOutgoingAndSend((short)0, (short)lc);
try this sample