|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--opencard.core.terminal.APDU
An APDU represents a Application Protocol Data Unit which is the basic unit of communication with a smart card.
CommandAPDU
,
ResponseAPDU
Field Summary | |
protected byte[] |
apdu_buffer
A buffer to hold the re-usable command APDU. |
protected int |
apdu_length
The length of the command APDU currently in the buffer. |
Constructor Summary | |
APDU(byte[] buffer)
Creates a new re-usable APDU and initializes it with the given buffer. |
|
APDU(byte[] buffer,
int length)
Creates a new re-usable APDU and initializes it with the given buffer. |
|
APDU(int size)
Creates a new re-usable APDU with a given buffer size. |
Method Summary | |
void |
append(byte b)
Appends the given byte to the internally buffered APDU. |
void |
append(byte[] bytes)
Appends the given byte array to the internally buffered APDU. |
byte[] |
getBuffer()
Returns the internal APDU buffer. |
int |
getByte(int index)
Gets the byte at the specified position in the buffer. |
byte[] |
getBytes()
Returns a byte array holding the buffered APDU. |
int |
getLength()
Returns the length of the buffered APDU. |
void |
setByte(int index,
int value)
Sets the byte at the specified position in the buffer. |
void |
setLength(int length)
Sets the length of valid range within the APDU buffer. |
java.lang.String |
toString()
Returns a human-readable string representation of this APDU. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected byte[] apdu_buffer
protected int apdu_length
Constructor Detail |
public APDU(byte[] buffer)
buffer
- the byte array to be used for holding the APDUgetLength()
public APDU(byte[] buffer, int length)
buffer
- the byte array to be used for holding the APDUlength
- the length of the APDU currently in the buffergetLength()
public APDU(int size)
size
- the size of the buffer to creategetLength()
Method Detail |
public void append(byte[] bytes) throws java.lang.IndexOutOfBoundsException
bytes
- the byte array to be appendedpublic void append(byte b) throws java.lang.IndexOutOfBoundsException
b
- the byte to be appendedpublic final byte[] getBuffer()
setLength(int)
public final int getByte(int index)
index
- the position in the buffersetByte(int, int)
,
getLength()
public final byte[] getBytes()
getBuffer()
public final int getLength()
public final void setByte(int index, int value)
index
- the position in the buffervalue
- the byte to store theregetByte(int)
,
append(byte)
public final void setLength(int length) throws java.lang.IndexOutOfBoundsException
length
- new length of the valid rangepublic java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |