|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--opencard.opt.iso.fs.CardRandomAccess | +--opencard.opt.iso.fs.CardRandomRecordAccess
CardRandomRecordAccess provides record-oriented, random access to structured smart card files. This class supports only linear files of either fixed or variable record size. There is no random access to cyclic files. To access transparent files, use CardRandomByteAccess CardRandomRecordAccess is loosely modeled on java.io.RandomAccessFile.
java.io.RandomAccessFile
,
CardRandomByteAccess
Fields inherited from class opencard.opt.iso.fs.CardRandomAccess |
file,
filePointer,
fileSystem,
open,
writeAccess |
Constructor Summary | |
CardRandomRecordAccess(CardFile scFile)
Instantiates a CardRandomRecordAccess. |
|
CardRandomRecordAccess(CardFile scFile,
java.lang.String accessMode)
Instantiates a CardRandomRecordAccess object. |
Method Summary | |
long |
getFilePointer()
Returns the current location of the file pointer. |
int |
read(CardRecord[] r)
Reads data into an array of CardRecords. |
int |
read(CardRecord[] r,
int off,
int len)
Reads a sub array as a sequence of CardRecords. |
CardRecord |
readRecord()
Reads a data record. |
void |
seek(long pos)
Sets the file pointer to the specified absolute position. |
int |
skip(int n)
Skips the number of records specified. |
void |
write(CardRecord r)
Writes a record. |
void |
write(CardRecord[] r)
Writes an array of records. |
void |
write(CardRecord[] r,
int off,
int len)
Writes a slice of a CardRecord array. |
Methods inherited from class opencard.opt.iso.fs.CardRandomAccess |
close,
finalize,
open |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public CardRandomRecordAccess(CardFile scFile) throws opencard.core.terminal.CardTerminalException, java.io.IOException
scFile
- The CardFile object that represents the file on the
smart card.public CardRandomRecordAccess(CardFile scFile, java.lang.String accessMode) throws opencard.core.terminal.CardTerminalException, java.io.IOException
scFile
- The CardFile object that represents the file on the
smart card.accessMode
- Specifies whether the card is accessed for read "r" or
read and write "rw".Method Detail |
public long getFilePointer() throws java.io.IOException, opencard.core.terminal.CardTerminalException
public void seek(long pos) throws java.io.EOFException, opencard.core.terminal.CardTerminalException
pos
- The absolute positionpublic int skip(int n) throws java.io.EOFException, opencard.core.terminal.CardTerminalException
n
- The number of records to skippublic CardRecord readRecord() throws java.io.IOException, opencard.core.terminal.CardTerminalException
public int read(CardRecord[] r) throws java.io.IOException, opencard.core.terminal.CardTerminalException
r
- The CardRecord array to store the records in.public int read(CardRecord[] r, int off, int len) throws java.io.IOException, opencard.core.terminal.CardTerminalException
r
- The data to be readoff
- The start offset in the datalen
- The number of records to be readpublic void write(CardRecord r) throws java.io.IOException, opencard.core.terminal.CardTerminalException
r
- The record to be writtenpublic void write(CardRecord[] r) throws java.io.IOException, opencard.core.terminal.CardTerminalException
r
- The records to be writtenpublic void write(CardRecord[] r, int off, int len) throws java.io.IOException, opencard.core.terminal.CardTerminalException
r
- The data to be writtenoff
- The start offset in the datalen
- The number of records to be written
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |