|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
opencard.opt.iso.fs.CardFileInputStream
public class CardFileInputStream
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.
CardFile
,
CardFileOutputStream
,
InputStream
Constructor Summary | |
---|---|
CardFileInputStream(CardFile file)
Instantiate an input stream using the specified CardFile object. |
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 |
Constructor Detail |
---|
public CardFileInputStream(CardFile file) throws java.io.IOException, CardTerminalException, CardIOException
file
- The CardFile object to base the input stream on.
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.Method Detail |
---|
public int available() throws java.io.IOException, CardTerminalException
available
in class java.io.InputStream
java.io.IOException
- Thrown if we encounter an IO error.
CardTerminalException
- Thrown when the smart card has been removed.public void close() throws java.io.IOException, CardTerminalException
close
in interface java.io.Closeable
close
in class java.io.InputStream
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public int read() throws java.io.IOException, CardTerminalException
read
in class java.io.InputStream
java.io.IOException
- Thrown if we encounter IO trouble.
CardTerminalException
- Thrown when the smart card has been removed.public int read(byte[] b) throws java.io.IOException, CardTerminalException
read
in class java.io.InputStream
b
- The buffer to use.
java.io.IOException
- Thrown if an IO error occured.
CardTerminalException
- Thrown when the smart card has been removed.public int read(byte[] b, int offset, int length) throws java.io.IOException, CardTerminalException
read
in class java.io.InputStream
b
- The buffer into which the data is readoffset
- The start offset of the datalength
- The maximum number of bytes to be read
java.io.IOException
- Thrown if an I/O error has occured.
CardTerminalException
- Thrown when the smart card has been removed.public long skip(long n) throws java.io.IOException, CardTerminalException
skip
in class java.io.InputStream
n
- The number of bytes to be skipped
java.io.IOException
- Thrown when skip()ing was not possible.
CardTerminalException
- Thrown when the smart card has been removed.protected void finalize() throws java.io.IOException
finalize
in class java.lang.Object
java.io.IOException
- Thrown when we encountered an IO error.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |