|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sim.toolkit.ViewHandler
The ViewHandler class offers basic services and contains basic methods to handle a Simple TLV List, such as in a Terminal Response data field or in a BER-TLV element (Envelope data field or Proactive command). The byte at offset 0 of a handler is the tag of the first Simple TLV.
ToolkitException
Method Summary | |
byte |
compareValue(short valueOffset,
byte[] compareBuffer,
short compareOffset,
short compareLength)
Compares the last found TLV element with a buffer. |
short |
copy(byte[] dstBuffer,
short dstOffset,
short dstLength)
Copies the simple TLV list contained in the handler to the destination byte array. |
short |
copyValue(short valueOffset,
byte[] dstBuffer,
short dstOffset,
short dstLength)
Copies a part of the last TLV element which has been found, into a destination buffer. |
byte |
findAndCompareValue(byte tag,
byte[] compareBuffer,
short compareOffset)
Looks for the first occurence of a TLV element from beginning of a TLV list and compare its value with a buffer. |
byte |
findAndCompareValue(byte tag,
byte occurence,
short valueOffset,
byte[] compareBuffer,
short compareOffset,
short compareLength)
Looks for the indicated occurence of a TLV element from the beginning of a TLV list and compare its value with a buffer. |
short |
findAndCopyValue(byte tag,
byte[] dstBuffer,
short dstOffset)
Looks for the first occurence of a TLV element from the beginning of a TLV list and copy its value into a destination buffer. |
short |
findAndCopyValue(byte tag,
byte occurence,
short valueOffset,
byte[] dstBuffer,
short dstOffset,
short dstLength)
Looks for the indicated occurence of a TLV element from the beginning of a TLV list and copy its value into a destination buffer. |
byte |
findTLV(byte tag,
byte occurrence)
Looks for the indicated occurence of a TLV element from the beginning of the TLV list (handler buffer). |
short |
getLength()
Returns the length of the TLV list. |
byte |
getValueByte(short valueOffset)
Gets a byte from the last TLV element which has been found in the handler. |
short |
getValueLength()
Gets the binary length of the value field for the last TLV element which has been found in the handler. |
Methods inherited from class java.lang.Object |
equals |
Method Detail |
public short getLength() throws ToolkitException
HANDLER_NOT_AVAILABLE
if the handler is busypublic short copy(byte[] dstBuffer, short dstOffset, short dstLength) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, ToolkitException
dstBuffer
- a reference to the destination bufferdstOffset
- the position in the destination bufferdstLength
- the data length to be copieddstOffset+dstLength
dstBuffer
is null
dstOffset
or dstLength
or both would cause access outside array bounds, or if dstLength
is negative.HANDLER_NOT_AVAILABLE
if the handler is busy
OUT_OF_TLV_BOUNDARIES
if dstLength
is grater than the length of the simple TLV List.public byte findTLV(byte tag, byte occurrence) throws ToolkitException
tag
- the tag of the TLV element to searchoccurrence
- the occurrence number of the TLV element (1 for the first, 2 for the second...)TLV_NOT_FOUND
if the required occurrence of the TLV element does not exist
TLV_FOUND_CR_SET
if the required occurence exists and Comprehension Required flag is set
TLV_FOUND_CR_NOT_SET
if the required occurence exists and Comprehension Required flag is not setHANDLER_NOT_AVAILABLE
if the handler is busy
BAD_INPUT_PARAMETER
if an input parameter is not valid (e.g. occurence = 0)public short getValueLength() throws ToolkitException
HANDLER_NOT_AVAILABLE
if the handler is busy
UNAVAILABLE_ELEMENT
in case of unavailable TLV elementpublic byte getValueByte(short valueOffset) throws ToolkitException
valueOffset
- the offset of the byte to return in the TLV elementHANDLER_NOT_AVAILABLE
if the handler is busy
UNAVAILABLE_ELEMENT
in case of unavailable TLV element
OUT_OF_TLV_BOUNDARIES
if valueOffset
is out of the current TLV public short copyValue(short valueOffset, byte[] dstBuffer, short dstOffset, short dstLength) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, ToolkitException
valueOffset
- the offset of the first byte in the source TLV elementdstBuffer
- a reference to the destination bufferdstOffset
- the position in the destination bufferdstLength
- the data length to be copieddstOffset+dstLength
dstBuffer
is null
dstOffset
or dstLength
or both would cause access outside array bounds, or if dstLength
is negative.HANDLER_NOT_AVAILABLE
if the handler is busy
UNAVAILABLE_ELEMENT
in case of unavailable TLV element
OUT_OF_TLV_BOUNDARIES
if valueOffset
, dstLength
or both are out of the current TLV public byte compareValue(short valueOffset, byte[] compareBuffer, short compareOffset, short compareLength) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, ToolkitException
valueOffset
- the offset of the first byte to compare in the TLV elementcompareBuffer
- a reference to the comparison buffercompareOffset
- the position in the comparison buffercompareLength
- the length to be compared0
if identical
-1
if the first miscomparing byte in simple TLV List is less than that in compareBuffer
,
1
if the first miscomparing byte in simple TLV List is greater than that in compareBuffer
.compareBuffer
is null
compareOffset
or compareLength
or both would cause access outside array bounds, or if compareLength
is negative.HANDLER_NOT_AVAILABLE
if the handler is busy
UNAVAILABLE_ELEMENT
in case of unavailable TLV element
OUT_OF_TLV_BOUNDARIES
if valueOffset
, compareLength
or both are out of the current TLV public short findAndCopyValue(byte tag, byte[] dstBuffer, short dstOffset) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, ToolkitException
UNAVAILABLE_ELEMENT
exception is thrown.
If the method is successful then the corresponding TLV becomes current,
else no TLV is selected.
This search method is Comprehension Required flag independent.tag
- the tag of the TLV element to searchdstBuffer
- a reference to the destination bufferdstOffset
- the position in the destination bufferdstOffset
+ length of the copied valuedstBuffer
is null
dstOffset
would cause access outside array boundsHANDLER_NOT_AVAILABLE
if the handler is busy
UNAVAILABLE_ELEMENT
in case of unavailable TLV elementpublic short findAndCopyValue(byte tag, byte occurence, short valueOffset, byte[] dstBuffer, short dstOffset, short dstLength) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, ToolkitException
UNAVAILABLE_ELEMENT
exception is thrown.
If the method is successful then the corresponding TLV becomes current,
else no TLV is selected.
This search method is Comprehension Required flag independent.tag
- the tag of the TLV element to searchoccurrence
- the occurrence number of the TLV element (1 for the first, 2 for the second...)valueOffset
- the offset of the first byte in the source TLV elementdstBuffer
- a reference to the destination bufferdstOffset
- the position in the destination bufferdstLength
- the data length to be copieddstOffset + dstLength
dstBuffer
is null
dstOffset
or dstLength
or both would cause access outside array bounds, or if dstLength
is negative.HANDLER_NOT_AVAILABLE
if the handler is busy
UNAVAILABLE_ELEMENT
in case of unavailable TLV element
OUT_OF_TLV_BOUNDARIES
if valueOffset
, dstLength
or both are out of the current TLV
BAD_INPUT_PARAMETER
if an input parameter is not valid (e.g. occurence = 0)public byte findAndCompareValue(byte tag, byte[] compareBuffer, short compareOffset) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, ToolkitException
UNAVAILABLE_ELEMENT
exception is thrown.
If the method is successful then the corresponding TLV becomes current,
else no TLV is selected.
This search method is Comprehension Required flag independent.tag
- the tag of the TLV element to searchcompareBuffer
- a reference to the comparison buffercompareOffset
- the position in the comparison buffer0
if identical
-1
if the first miscomparing byte in simple TLV is less than that in compareBuffer
,
1
if the first miscomparing byte in simple TLV is greater than that in compareBuffer
.compareBuffer
is null
compareOffset
would cause access outside array boundsHANDLER_NOT_AVAILABLE
if the handler is busy
UNAVAILABLE_ELEMENT
in case of unavailable TLV elementpublic byte findAndCompareValue(byte tag, byte occurence, short valueOffset, byte[] compareBuffer, short compareOffset, short compareLength) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException, ToolkitException
UNAVAILABLE_ELEMENT
exception is thrown.
If the method is successful then the corresponding TLV becomes current,
else no TLV is selected.
This search method is Comprehension Required flag independent.tag
- the tag of the TLV element to searchoccurrence
- the occurrence number of the TLV element (1 for the first, 2 for the second...)valueOffset
- the offset of the first byte in the source TLV elementcompareBuffer
- a reference to the comparison buffercompareOffset
- the position in the comparison buffercompareLength
- the length to be compared0
if identical
-1
if the first miscomparing byte in simple TLV is less than that in compareBuffer
,
1
if the first miscomparing byte in simple TLV is greater than that in compareBuffer
.compareBuffer
is null
compareOffset
or compareLength
or both would cause access outside array bounds, or if compareLength
is negative.HANDLER_NOT_AVAILABLE
if the handler is busy
UNAVAILABLE_ELEMENT
in case of unavailable TLV element
OUT_OF_TLV_BOUNDARIES
if valueOffset
, compareLength
or both are out of the current TLV
BAD_INPUT_PARAMETER
if an input parameter is not valid (e.g. occurence = 0)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |