|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectopencard.opt.iso.fs.CardRandomAccess
opencard.opt.iso.fs.CardRandomByteAccess
public class CardRandomByteAccess
CardRandomByteAccess provides a byte-oriented way of accessing a card file (for transparent smart card files).
CardFile
,
RandomAccessFile
,
DataInput
,
DataOutput
Field Summary |
---|
Fields inherited from class opencard.opt.iso.fs.CardRandomAccess |
---|
file, filePointer, fileSystem, open, writeAccess |
Constructor Summary | |
---|---|
CardRandomByteAccess(CardFile scFile)
Instantiate a CardRandomByteAccess object. |
|
CardRandomByteAccess(CardFile scFile,
java.lang.String accessMode)
Instantiate a CardRandomByteAccess object. |
Method Summary | |
---|---|
protected void |
finalize()
Let the super class free any resources. |
int |
read()
Reads a byte of data. |
int |
read(byte[] b)
Reads data into an array of bytes. |
int |
read(byte[] b,
int off,
int len)
Reads a sub array as a sequence of bytes. |
boolean |
readBoolean()
Reads a boolean. |
byte |
readByte()
Reads a byte. |
char |
readChar()
Reads a 16 bit char. |
double |
readDouble()
Reads a 64 bit double. |
float |
readFloat()
Reads a 32 bit float. |
void |
readFully(byte[] b)
Reads bytes, blocking until all bytes are read. |
void |
readFully(byte[] b,
int off,
int len)
Reads bytes, blocking until all bytes are read. |
int |
readInt()
Reads a 32 bit int. |
java.lang.String |
readLine()
Reads a line terminated by a '\n' or EOF. |
long |
readLong()
Reads a 64 bit long. |
short |
readShort()
Reads a 16 bit short. |
int |
readUnsignedByte()
Reads an unsigned 8 bit byte. |
int |
readUnsignedShort()
Reads 16 bit unsigned short. |
java.lang.String |
readUTF()
Reads a UTF formatted String. |
int |
skipBytes(int n)
Skips the number of bytes specified. |
void |
write(byte[] b)
Writes an array of bytes. |
void |
write(byte[] b,
int off,
int len)
Writes a slice of a byte array. |
void |
write(int b)
Writes a byte of data. |
void |
writeBoolean(boolean v)
Writes a boolean. |
void |
writeByte(int v)
Writes a byte. |
void |
writeBytes(java.lang.String s)
Write a String as a sequence of bytes. |
void |
writeChar(int v)
Writes a character. |
void |
writeChars(java.lang.String s)
Writes a String as a sequence of chars. |
void |
writeDouble(double v)
Writes a double. |
void |
writeFloat(float v)
Writes a float. |
void |
writeInt(int v)
Write an integer. |
void |
writeLong(long v)
Writes a long. |
void |
writeShort(int v)
Writes a short. |
void |
writeUTF(java.lang.String str)
Writes a String in UTF format. |
Methods inherited from class opencard.opt.iso.fs.CardRandomAccess |
---|
close, open |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CardRandomByteAccess(CardFile scFile) throws CardTerminalException, java.io.IOException
scFile
- The CardFile object that represents the file on the
smart card.
CardTerminalException
- Thrown when the smart card has been removed.
java.io.IOException
- Thrown for all other I/O exceptions.public CardRandomByteAccess(CardFile scFile, java.lang.String accessMode) throws 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/write "rw".
CardTerminalException
- Thrown when the smart card has been removed.
java.io.IOException
- Thrown for all other I/O exceptions.Method Detail |
---|
public int read() throws java.io.IOException, CardTerminalException
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public int read(byte[] b) throws java.io.IOException, CardTerminalException
b
- A buffer to put the data into.
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public int read(byte[] b, int off, int len) throws java.io.IOException, CardTerminalException
b
- the buffer to read the data intooff
- The start offset in the data bufferlen
- The number of bytes to read
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.
#state specifiedpublic boolean readBoolean() throws java.io.IOException, CardTerminalException
readBoolean
in interface java.io.DataInput
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public byte readByte() throws java.io.IOException, CardTerminalException
readByte
in interface java.io.DataInput
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public char readChar() throws java.io.IOException, CardTerminalException
readChar
in interface java.io.DataInput
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public double readDouble() throws java.io.IOException, CardTerminalException
readDouble
in interface java.io.DataInput
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public float readFloat() throws java.io.IOException, CardTerminalException
readFloat
in interface java.io.DataInput
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public void readFully(byte[] b) throws java.io.IOException, CardTerminalException
readFully
in interface java.io.DataInput
b
- The buffer into which the data is read
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public void readFully(byte[] b, int off, int len) throws java.io.IOException, CardTerminalException
readFully
in interface java.io.DataInput
b
- The buffer into which the data is readoff
- The start offset of the datalen
- The number of bytes to read
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public int readInt() throws java.io.IOException, CardTerminalException
readInt
in interface java.io.DataInput
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public java.lang.String readLine() throws java.io.IOException, CardTerminalException
readLine
in interface java.io.DataInput
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public long readLong() throws java.io.IOException, CardTerminalException
readLong
in interface java.io.DataInput
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public short readShort() throws java.io.IOException, CardTerminalException
readShort
in interface java.io.DataInput
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public int readUnsignedByte() throws java.io.IOException, CardTerminalException
readUnsignedByte
in interface java.io.DataInput
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public int readUnsignedShort() throws java.io.IOException, CardTerminalException
readUnsignedShort
in interface java.io.DataInput
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public int skipBytes(int n) throws java.io.IOException, CardTerminalException
skipBytes
in interface java.io.DataInput
n
- The number of bytes to skip
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public java.lang.String readUTF() throws java.io.IOException, CardTerminalException
readUTF
in interface java.io.DataInput
java.io.IOException
- Thrown If an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public void write(int b) throws java.io.IOException, CardTerminalException
write
in interface java.io.DataOutput
b
- The byte to be written
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public void write(byte[] b) throws java.io.IOException, CardTerminalException
write
in interface java.io.DataOutput
b
- The data to be written
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public void write(byte[] b, int off, int len) throws java.io.IOException, CardTerminalException
write
in interface java.io.DataOutput
b
- The data to be writtenoff
- The start offset in the datalen
- The number of bytes that are written
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public void writeBoolean(boolean v) throws java.io.IOException, CardTerminalException
writeBoolean
in interface java.io.DataOutput
v
- The boolean value
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public void writeByte(int v) throws java.io.IOException, CardTerminalException
writeByte
in interface java.io.DataOutput
v
- The byte to write.
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public void writeBytes(java.lang.String s) throws java.io.IOException, CardTerminalException
writeBytes
in interface java.io.DataOutput
s
- The String to write.
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public void writeChar(int v) throws java.io.IOException, CardTerminalException
writeChar
in interface java.io.DataOutput
v
- The char to write
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public void writeChars(java.lang.String s) throws java.io.IOException, CardTerminalException
writeChars
in interface java.io.DataOutput
s
- The String to write.
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public void writeDouble(double v) throws java.io.IOException, CardTerminalException
writeDouble
in interface java.io.DataOutput
v
- The double to write.
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public void writeFloat(float v) throws java.io.IOException, CardTerminalException
writeFloat
in interface java.io.DataOutput
v
- The float to write
java.io.IOException
- Thrown If an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public void writeInt(int v) throws java.io.IOException, CardTerminalException
writeInt
in interface java.io.DataOutput
v
- The integer to write.
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public void writeLong(long v) throws java.io.IOException, CardTerminalException
writeLong
in interface java.io.DataOutput
v
- The long to write.
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public void writeShort(int v) throws java.io.IOException, CardTerminalException
writeShort
in interface java.io.DataOutput
v
- The short to write
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.public void writeUTF(java.lang.String str) throws java.io.IOException, CardTerminalException
writeUTF
in interface java.io.DataOutput
str
- The String to write.
java.io.IOException
- Thrown if an I/O error has occurred.
CardTerminalException
- Thrown when the smart card has been removed.protected void finalize() throws java.io.IOException
finalize
in class CardRandomAccess
java.io.IOException
- An I/O error occurred during resource deallocation.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |