|
Nokia Extensions for JSR-257 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MFSectorTrailer
Provides access to a sector trailer.
Field Summary |
---|
Fields inherited from interface com.nokia.nfc.nxp.mfstd.MFBlock |
---|
BLOCK_LEN, BLOCKTYPE_DATA, BLOCKTYPE_MANUFACTURER, BLOCKTYPE_TRAILER, MAX_DIFF, MIN_DIFF |
Method Summary | |
---|---|
MFTrailerContents |
readTrailerContents(MFKey key)
Reads the contents of this sector trailer from the card using the given authentication key. |
void |
write(MFKey key,
byte[] src,
int dstOffset)
Writes the given byte array src to this data area
starting from dstOffset . |
void |
write(MFKey key,
byte[] src,
int srcOffset,
int length,
int dstOffset)
Writes the given data to the data area starting at the byte offset dstOffset . |
void |
writeTrailerContents(MFKey key,
MFTrailerContents contents)
Writes new contents to this sector trailer block. |
void |
writeValue(MFKey key,
MFValue newValue)
Always throws a MFStandardException as the sector trailer cannot
be used as a value block. |
Methods inherited from interface com.nokia.nfc.nxp.mfstd.MFBlock |
---|
copyFrom, copyTo, decrement, getBlockIndex, getBlockType, increment, isValueBlock, readValue |
Methods inherited from interface com.nokia.nfc.nxp.mfstd.MFDataArea |
---|
read, size, toString |
Method Detail |
---|
MFTrailerContents readTrailerContents(MFKey key) throws MFStandardException, java.io.IOException
key
- the authentication key. If null
then the device's default keys are used.
MFTrailerContents
object.
MFStandardException
- if authentication fails.
java.io.IOException
- if a connection error occurs.void writeTrailerContents(MFKey key, MFTrailerContents contents) throws MFStandardException, java.io.IOException
contents
object must be set to non-null values.
key
- the authentication key. If null
then the device's default keys are used.contents
- the new sector trailer contents.
MFStandardException
- if authentication fails.
java.io.IOException
- if a connection error occurs.
java.lang.NullPointerException
- if any of the contents
object's fields are null
.void write(MFKey key, byte[] src, int dstOffset) throws MFStandardException, java.io.IOException
Writes the given byte array src
to this data area
starting from dstOffset
.
Because partial writes are not supported for sector trailers the
dstOffset
must always be 0
and the src
array length must always be 16
. Otherwise an
IllegalArgumentException
will be thrown.
write
in interface MFDataArea
key
- the authentication key. If null
then the device's default keys are used.src
- the data to write.dstOffset
- the offset in this data area.
MFStandardException
- if authentication fails.
java.io.IOException
- if a connection error occurs.
java.lang.NullPointerException
- if src
is null
.
java.lang.IllegalArgumentException
- if the destination byte range is out of bounds.void write(MFKey key, byte[] src, int srcOffset, int length, int dstOffset) throws MFStandardException, java.io.IOException
Writes the given data to the data area starting at the byte offset
dstOffset
. The data to be written is read from
the source array src
starting at offset srcOffset
.
Because partial writes are not supported for sector trailers the
dstOffset
must always be 0
and the length
must always be 16
. Otherwise an IllegalArgumentException
will
be thrown.
write
in interface MFDataArea
key
- the authentication key. If null
then the device's default keys are used.src
- the source array.srcOffset
- the offset in the source array.length
- the number of bytes to read from the source array.dstOffset
- the offset in this data area.
MFStandardException
- if authentication fails or if the write conditions are not met.
java.io.IOException
- if a connection error occurs.
java.lang.NullPointerException
- if src
is null
.
java.lang.IllegalArgumentException
- if either the source or destination byte range is out of bounds.void writeValue(MFKey key, MFValue newValue) throws MFStandardException, java.io.IOException
MFStandardException
as the sector trailer cannot
be used as a value block.
writeValue
in interface MFBlock
key
- the authentication key. If null
then the device's default keys are used.newValue
- new value block contents
MFStandardException
- if authentication fails.
java.io.IOException
- if a connection error occurs.MFBlock.writeValue(com.nokia.nfc.nxp.mfstd.MFKey, com.nokia.nfc.nxp.mfstd.MFValue)
|
Nokia Extensions for JSR-257 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |