opencard.opt.iso.fs
Class CardFileInputStream
java.lang.Object
|
+--java.io.InputStream
|
+--opencard.opt.iso.fs.CardFileInputStream
- public class CardFileInputStream
- extends java.io.InputStream
CardFileInputStream together with the accompanying
CardFileOutputStream provides access to a CardFile via
the familiar Java input/output stream mechanism.
This class only works on transparent files.
- Version:
- $Id: CardFileInputStream.java,v 1.2 1999/11/03 12:37:17 damke Exp $
- See Also:
CardFile,
CardFileOutputStream,
InputStream
|
Method Summary |
int |
available()
Return the number of byte available for reading. |
void |
close()
Close the input stream and release any resources associated with
the stream. |
protected void |
finalize()
Close the stream at garbage collection time. |
int |
read()
Read a byte of data. |
int |
read(byte[] b)
Read data into a byte array. |
int |
read(byte[] b,
int offset,
int length)
Reads data into a slice of a byte array. |
long |
skip(long n)
Skips n bytes of input. |
| Methods inherited from class java.io.InputStream |
mark,
markSupported,
reset |
| Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
CardFileInputStream
public CardFileInputStream(CardFile file)
throws java.io.IOException,
CardTerminalException,
CardIOException
- Instantiate an input stream using the specified CardFile object.
- Parameters:
file - The CardFile object to base the input stream on.- Throws:
- java.io.IOException - Thrown when the file open fails.
- CardIOException - The file is not found or it's type is not transparent.
- CardTerminalException - Thrown when the smart card has been removed.
available
public int available()
throws java.io.IOException,
CardTerminalException
- Return the number of byte available for reading.
- Returns:
- The number of bytes available for reading without blocking.
- Throws:
- java.io.IOException - Thrown if we encounter an IO error.
- CardTerminalException - Thrown when the smart card has been removed.
- Overrides:
- available in class java.io.InputStream
close
public void close()
throws java.io.IOException,
CardTerminalException
- Close the input stream and release any resources associated with
the stream.
- Throws:
- java.io.IOException - Thrown if an I/O error has occurred.
- CardTerminalException - Thrown when the smart card has been removed.
- Overrides:
- close in class java.io.InputStream
read
public int read()
throws java.io.IOException,
CardTerminalException
- Read a byte of data.
- Returns:
- The byte read, or -1 if we reached the end of
the input stream.
- Throws:
- java.io.IOException - Thrown if we encounter IO trouble.
- CardTerminalException - Thrown when the smart card has been removed.
- Overrides:
- read in class java.io.InputStream
read
public int read(byte[] b)
throws java.io.IOException,
CardTerminalException
- Read data into a byte array.
- Parameters:
b - The buffer to use.- Returns:
- The actual number of bytes read, or -1 if we reached
the end of the input stream.
- Throws:
- java.io.IOException - Thrown if an IO error occured.
- CardTerminalException - Thrown when the smart card has been removed.
- Overrides:
- read in class java.io.InputStream
read
public int read(byte[] b,
int offset,
int length)
throws java.io.IOException,
CardTerminalException
- Reads data into a slice of a byte array.
- Parameters:
b - The buffer into which the data is readoffset - The start offset of the datalength - The maximum number of bytes to be read- Returns:
- The actual number of bytes read, or -1 if we reached
end of the rainbow, err, input stream.
- Throws:
- java.io.IOException - Thrown if an I/O error has occured.
- CardTerminalException - Thrown when the smart card has been removed.
- Overrides:
- read in class java.io.InputStream
skip
public long skip(long n)
throws java.io.IOException,
CardTerminalException
- Skips n bytes of input.
- Parameters:
n - The number of bytes to be skipped- Returns:
- The actual number of bytes skipped.
- Throws:
- java.io.IOException - Thrown when skip()ing was not possible.
- CardTerminalException - Thrown when the smart card has been removed.
- Overrides:
- skip in class java.io.InputStream
finalize
protected void finalize()
throws java.io.IOException
- Close the stream at garbage collection time.
- Throws:
- java.io.IOException - Thrown when we encountered an IO error.
- Overrides:
- finalize in class java.lang.Object
|