public final class JCint extends Object
JCint
class contains common utility functions using ints.
Some of the methods may be implemented as native functions for performance
reasons. All the methods in JCint
class are static methods.
The methods makeTransientIntArray()
and and
setInt()
, refer to the persistence of array objects. The term
persistent means that arrays and their values persist from one CAD
session to the next, indefinitely. The makeTransientIntArray()
method is used to create transient int arrays. Constants related to
transience control are available in the JCSystem
class.
javacard.framework.JCSystem
Modifier and Type | Method and Description |
---|---|
static int |
getInt(byte[] bArray,
short bOff)
Concatenates four bytes in a byte array to form a int value.
|
static int |
makeInt(byte b1,
byte b2,
byte b3,
byte b4)
Concatenates the four parameter bytes to form an int value.
|
static int |
makeInt(short s1,
short s2)
Concatenates the two parameter short values to form an int value.
|
static int[] |
makeTransientIntArray(short length,
byte event)
Creates a transient int array with the specified array length.
|
static short |
setInt(byte[] bArray,
short bOff,
int iValue)
Deposits the int value as four successive bytes at the specified offset
in the byte array.
|
public static final int makeInt(byte b1, byte b2, byte b3, byte b4)
b1
- the first byte ( high order byte )b2
- the second byteb3
- the third byteb4
- the fourth byte ( low order byte )public static final int makeInt(short s1, short s2)
s1
- the first short value ( high order short value )s2
- the second short value ( low order short value )public static final int getInt(byte[] bArray, short bOff) throws NullPointerException, ArrayIndexOutOfBoundsException
bArray
- byte arraybOff
- offset within byte array containing first byte (the high order
byte)NullPointerException
- if the bArray
parameter is null
ArrayIndexOutOfBoundsException
- if the bOff
parameter is negative or if
bOff+4
is greater than the length of
bArray
public static final short setInt(byte[] bArray, short bOff, int iValue) throws TransactionException, NullPointerException, ArrayIndexOutOfBoundsException
bArray
- byte arraybOff
- offset within byte array to deposit the first byte (the high
order byte)iValue
- the short value to set into array.bOff+4
Note:
TransactionException
exception is thrown.TransactionException
- if the operation would cause the commit capacity to be
exceededNullPointerException
- if the bArray
parameter is null
ArrayIndexOutOfBoundsException
- if the bOff
parameter is negative or if
bOff+4
is greater than the length of
bArray
javacard.framework.JCSystem.getUnusedCommitCapacity()
public static int[] makeTransientIntArray(short length, byte event) throws NegativeArraySizeException, SystemException
length
- the length of the int arrayevent
- the CLEAR_ON...
event which causes the array
elements to be clearedNegativeArraySizeException
- if the length
parameter is negativeSystemException
- with the following reason codes:
SystemException.ILLEGAL_VALUE
if event
is not a valid event code.
SystemException.NO_TRANSIENT_SPACE
if
sufficient transient space is not available.
SystemException.ILLEGAL_TRANSIENT
if
the current applet context is not the currently selected
applet context and CLEAR_ON_DESELECT
is
specified.
javacard.framework.JCSystem
Copyright © 1998, 2015, Oracle and/or its affiliates. All rights reserved.