opencard.opt.iso.fs
Class CardRandomAccess

java.lang.Object
  extended by opencard.opt.iso.fs.CardRandomAccess
Direct Known Subclasses:
CardRandomByteAccess, CardRandomRecordAccess

public abstract class CardRandomAccess
extends java.lang.Object

Superclass for both CardRandomAccess classes.

Version:
$Id: CardRandomAccess.java,v 1.2 1999/11/03 12:37:18 damke Exp $
Author:
Peter Trommler (trp@zurich.ibm.com)
See Also:
CardRandomRecordAccess, CardRandomByteAccess

Field Summary
protected  CardFile file
           
protected  int filePointer
           
protected  FileAccessCardService fileSystem
           
protected  boolean open
           
protected  boolean writeAccess
           
 
Constructor Summary
CardRandomAccess(CardFile scFile, java.lang.String accessMode)
          Instantiate a CardRandomAccess object.
 
Method Summary
 void close()
          Close the file.
protected  void finalize()
          Free up all resources at garbage collection time.
 void open()
          (Re-)open the file.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

protected CardFile file

fileSystem

protected FileAccessCardService fileSystem

filePointer

protected int filePointer

writeAccess

protected boolean writeAccess

open

protected boolean open
Constructor Detail

CardRandomAccess

public CardRandomAccess(CardFile scFile,
                        java.lang.String accessMode)
                 throws CardTerminalException,
                        java.io.IOException
Instantiate a CardRandomAccess object.

Parameters:
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".
Throws:
CardTerminalException - Thrown when the smart card has been removed.
java.io.IOException
Method Detail

close

public void close()
           throws java.io.IOException,
                  CardTerminalException
Close the file.

Throws:
java.io.IOException - Thrown if an I/O error has occurred.
CardTerminalException - Thrown when the smart card has been removed.

open

public void open()
          throws java.io.IOException,
                 CardTerminalException
(Re-)open the file.

Throws:
java.io.IOException - Thrown if an I/O error has occured.
CardTerminalException - Thrown when the smart card has been removed.

finalize

protected void finalize()
                 throws java.io.IOException
Free up all resources at garbage collection time.

Overrides:
finalize in class java.lang.Object
Throws:
java.io.IOException - An I/O error occurred.