|
Nokia Extensions for JSR-257 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MFApplication
Class that provides access to a Mifare Standard Card's application.
Note that the read(MFKey, byte[], int, int, int)
and
write(MFKey, byte[], int, int, int)
methods skip the sector trailers and
thus only address the actual data area of the application.
Modification of sector trailers is provided though the
updateTrailerContents(MFKey, MFTrailerContents)
method and
a more direct access through the methods provided by MFSector
.
Method Summary | |
---|---|
byte[] |
getApplicationIdentifier()
Returns the identifier of this application. |
MFSector[] |
getSectors()
Returns the sectors reserved for the application. |
void |
read(MFKey key,
byte[] dst,
int dstOffset,
int srcOffset,
int length)
Reads data from the application's data area. |
int |
size()
Returns the total amount of bytes reserved for the application. |
void |
updateTrailerContents(MFKey key,
MFTrailerContents contents)
Updates the sector trailers of the application with the information specified by the given MFTrailerContents object. |
void |
write(MFKey key,
byte[] src,
int srcOffset,
int length,
int dstOffset)
Writes data to the application's data area. |
Method Detail |
---|
MFSector[] getSectors()
byte[] getApplicationIdentifier()
int size()
void updateTrailerContents(MFKey key, MFTrailerContents contents) throws java.io.IOException, MFStandardException
MFTrailerContents
object.
key
- the authentication key. If null
then the device's default keys are used.contents
- application's new trailer contents.
MFStandardException
- if authentication fails.
java.io.IOException
- if a connection error occurs.
java.lang.NullPointerException
- if contents
is null
.void read(MFKey key, byte[] dst, int dstOffset, int srcOffset, int length) throws MFStandardException, java.io.IOException
srcOffset
and ends at srcOffset+length-1
.
The read data is stored in the dst
array starting at
position dstOffset
.
key
- the authentication key. If null
then the device's default keys are used.dst
- the array where to store the read data.dstOffset
- start position in the destination array.srcOffset
- the offset from which to start reading the data.length
- amount of bytes to read.
MFStandardException
- if authentication fails.
java.io.IOException
- if a connection error occurs.
java.lang.NullPointerException
- if dst
is null
.
java.lang.IllegalArgumentException
- if either one of the specified byte ranges is invalid.void write(MFKey key, byte[] src, int srcOffset, int length, int dstOffset) throws MFStandardException, java.io.IOException
src
array starting at position
srcOffset
and ending at position srcOffset+length-1
.
The starting position in the application's data area is defined
by dstOffset
.
key
- the authentication key. If null
then the device's default keys are used.src
- the data to write.srcOffset
- start position in the source array.length
- amount of bytes to write.dstOffset
- start offset in the application's data area.
MFStandardException
- if authentication fails.
java.io.IOException
- if a connection error occurs.
java.lang.NullPointerException
- if data
is null
.
java.lang.IllegalArgumentException
- if either the specified byte range is invalid.
|
Nokia Extensions for JSR-257 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |