public class UtilProxy extends Object
UtilUtil| Constructor and Description |
|---|
UtilProxy() |
| Modifier and Type | Method and Description |
|---|---|
static byte |
arrayCompare(byte[] src,
short srcOff,
byte[] dest,
short destOff,
short length)
Compares an array from the specified source array,
beginning at the specified position,
with the specified position of the destination array from left to right.
|
static short |
arrayCopy(byte[] src,
short srcOff,
byte[] dest,
short destOff,
short length)
Copies an array from the specified source array,
beginning at the specified position,
to the specified position of the destination array.
|
static short |
arrayCopyNonAtomic(byte[] src,
short srcOff,
byte[] dest,
short destOff,
short length)
Copies an array from the specified source array,
beginning at the specified position,
to the specified position of the destination array (non-atomically).
|
static short |
arrayFillNonAtomic(byte[] bArray,
short bOff,
short bLen,
byte bValue)
Fills the byte array (non-atomically) beginning at the specified position,
for the specified length with the specified byte value.
|
static short |
getShort(byte[] bArray,
short bOff)
Concatenates two bytes in a byte array to form a short value.
|
static short |
makeShort(byte b1,
byte b2)
Concatenates the two parameter bytes to form a short value.
|
static short |
setShort(byte[] bArray,
short bOff,
short sValue)
Deposits the short value as two successive bytes at the specified offset in the byte array.
|
public static final short arrayCopy(byte[] src,
short srcOff,
byte[] dest,
short destOff,
short length)
throws ArrayIndexOutOfBoundsException,
NullPointerException,
javacard.framework.TransactionException
Note:
System.arraycopy method and no supported transactions ! !!!srcOff or destOff or length parameter
is negative an ArrayIndexOutOfBoundsException exception is thrown.srcOff+length is greater than src.length, the length
of the src array a ArrayIndexOutOfBoundsException exception is thrown
and no copy is performed.destOff+length is greater than dest.length, the length
of the dest array an ArrayIndexOutOfBoundsException exception is thrown
and no copy is performed.src or dest parameter is null
a NullPointerException exception is thrown.src and dest arguments refer to the same array object,
then the copying is performed as if the components at positions srcOff
through srcOff+length-1 were first copied to a temporary array with length components
and then the contents of the temporary array were copied into
positions destOff through destOff+length-1 of the argument array.TransactionException
exception is thrown.src - source byte arraysrcOff - offset within source byte array to start copy fromdest - destination byte arraydestOff - offset within destination byte array to start copy intolength - byte length to be copiedArrayIndexOutOfBoundsException - if copying would cause access of data outside array boundsNullPointerException - if either src or dest is nulljavacard.framework.TransactionException - if copying would cause the commit capacity to be exceededJCSystem.getUnusedCommitCapacity()public static final short arrayCopyNonAtomic(byte[] src,
short srcOff,
byte[] dest,
short destOff,
short length)
throws ArrayIndexOutOfBoundsException,
NullPointerException
This method does not use the transaction facility during the copy operation even if a transaction is in progress. Thus, this method is suitable for use only when the contents of the destination array can be left in a partially modified state in the event of a power loss in the middle of the copy operation.
Note:
System.arraycopy method and no supported transactions ! !!!srcOff or destOff or length parameter
is negative an ArrayIndexOutOfBoundsException exception is thrown.
srcOff+length is greater than src.length, the length
of the src array a ArrayIndexOutOfBoundsException exception is thrown
and no copy is performed.
destOff+length is greater than dest.length, the length
of the dest array an ArrayIndexOutOfBoundsException exception is thrown
and no copy is performed.
src or dest parameter is null
a NullPointerException exception is thrown.
src and dest arguments refer to the same array object,
then the copying is performed as if the components at positions srcOff
through srcOff+length-1 were first copied to a temporary array with length components
and then the contents of the temporary array were copied into
positions destOff through destOff+length-1 of the argument array.
length parameter is not constrained by the atomic commit capacity limitations.src - source byte arraysrcOff - offset within source byte array to start copy fromdest - destination byte arraydestOff - offset within destination byte array to start copy intolength - byte length to be copiedArrayIndexOutOfBoundsException - if copying would cause access of data outside array boundsNullPointerException - if either src or dest is nulljavacard.framework.TransactionException - if copying would cause the commit capacity to be exceededJCSystem.getUnusedCommitCapacity()public static final short arrayFillNonAtomic(byte[] bArray,
short bOff,
short bLen,
byte bValue)
throws ArrayIndexOutOfBoundsException,
NullPointerException
This method does not use the transaction facility during the fill operation even if a transaction is in progress. Thus, this method is suitable for use only when the contents of the byte array can be left in a partially filled state in the event of a power loss in the middle of the fill operation.
Note:
bOff or bLen parameter
is negative an ArrayIndexOutOfBoundsException exception is thrown.
bOff+bLen is greater than bArray.length, the length
of the bArray array an ArrayIndexOutOfBoundsException exception is thrown.
bArray parameter is null
a NullPointerException exception is thrown.
bLen parameter is not constrained by the atomic commit capacity limitations.bArray - the byte arraybOff - offset within byte array to start filling bValue intobLen - byte length to be filledbValue - the value to fill the byte array withArrayIndexOutOfBoundsException - if the fill operation would cause access of data outside array boundsNullPointerException - if bArray is nullJCSystem.getUnusedCommitCapacity()public static final byte arrayCompare(byte[] src,
short srcOff,
byte[] dest,
short destOff,
short length)
throws ArrayIndexOutOfBoundsException,
NullPointerException
Note:
srcOff or destOff or length parameter
is negative an ArrayIndexOutOfBoundsException exception is thrown.
srcOff+length is greater than src.length, the length
of the src array a ArrayIndexOutOfBoundsException exception is thrown.
destOff+length is greater than dest.length, the length
of the dest array an ArrayIndexOutOfBoundsException exception is thrown.
src or dest parameter is null
a NullPointerException exception is thrown.
src - source byte arraysrcOff - offset within source byte array to start comparedest - destination byte arraydestOff - offset within destination byte array to start comparelength - byte length to be compared0 if identical-1 if the first miscomparing byte in source array is less than that in destination array1 if the first miscomparing byte in source array is greater that that in destination arrayArrayIndexOutOfBoundsException - if comparing all bytes would cause access of data outside array boundsNullPointerException - if either src or dest is nullpublic static final short makeShort(byte b1,
byte b2)
b1 - the first byte ( high order byte )b2 - the second byte ( low order byte )public static final short getShort(byte[] bArray,
short bOff)
throws ArrayIndexOutOfBoundsException,
NullPointerException
bArray - byte arraybOff - offset within byte array containing first byte (the high order byte)ArrayIndexOutOfBoundsException - if the bOff parameter is negative or if bOff+2 is greater than the length of bArrayNullPointerException - if the bArray parameter is nullpublic static final short setShort(byte[] bArray,
short bOff,
short sValue)
throws javacard.framework.TransactionException,
ArrayIndexOutOfBoundsException,
NullPointerException
bArray - byte arraybOff - offset within byte array to deposit the first byte (the high order byte)sValue - the short value to set into array.bOff+2
Note:
TransactionException
exception is thrown.ArrayIndexOutOfBoundsException - if the bOff parameter is negative or if bOff+2 is greater than the length of bArray
of bArrayNullPointerException - if the bArray parameter is nulljavacard.framework.TransactionException - if the operation would cause the commit capacity to be exceededJCSystem.getUnusedCommitCapacity()