Methods Summary |
---|
byte | findRecord(byte firstByte)Find the record.
byte eRecNum = num_record--; //max record
byte currentRecNumber = 1;
byte thisRec[];
while (true) {
thisRec = getRecord(currentRecNumber);
if ( firstByte == 0) {
return currentRecNumber;
}
if ( thisRec[0] == firstByte) {
return currentRecNumber;
}
if ( currentRecNumber == eRecNum )
return 0;
currentRecNumber++;
}
|
byte[] | getNewLogRecord()Get a new record
byte[] record = records[next_record].record;
return record;
|
byte[] | getRecord(byte recordNum)Get a record with the specified record number
// check if the record number is in the range of 1..maximum record number
if ( ( recordNum < 1 ) || ( recordNum > (byte)(num_record - 1 ) ) )
ISOException.throwIt(ISO7816.SW_RECORD_NOT_FOUND);
if ((recordNum = (byte) (current_record - recordNum + 1)) < 0 )
recordNum += num_record;
return records[recordNum].record;
|
void | updateNewLogRecord()Update internal record pointers, so the new record
becomes the current record and the oldest
record in CyclicFile becomes the next new record
// update current record pointer and next record pointer
if (++current_record == num_record)
current_record = 0;
if (++next_record == num_record)
next_record = 0;
|