**javacardx.framework.util.intx** ====Class JCint ==== *[[javacard:java-card-api:object|java.lang.Object]] \\ ---- public final class **JCint**extends [[javacard:java-card-api:Object|Object]] The 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. **Since:** 2.2.2 **See Also:**[[javacard:java-card-api:JCSystem|javacard.framework.JCSystem]] ---- ^ Method Summary ^^ | **static int** | **[[javacard:java-card-api:JCint#getInt(byte[], short)|getInt]] **(byte[] bArray,short bOff)          Concatenates four bytes in a byte array to form a int value. | | **static int** | **[[javacard:java-card-api:JCint#makeInt(byte, byte, byte, byte)|makeInt]] **(byte b1,byte b2,byte b3,byte b4)          Concatenates the four parameter bytes to form an int value. | | **static int** | **[[javacard:java-card-api:JCint#makeInt(short, short)|makeInt]] **(short s1,short s2)          Concatenates the two parameter short values to form an int value. | | **static int[]** | **[[javacard:java-card-api:JCint#makeTransientIntArray(short, byte)|makeTransientIntArray]] **(short length,byte event)          Creates a transient int array with the specified array length. | | **static short** | **[[javacard:java-card-api:JCint#setInt(byte[], short, int)|setInt]] **(byte[] bArray,short bOff,int iValue)          Deposits the int value as four successive bytes at the specified offset in the byte array. |   ^ Methods inherited from class java.lang.Object ^ | [[javacard:java-card-api:Object#equals(java.lang.Object)|equals]] |   ^ Method Detail ^ === makeInt === public static final int **makeInt**(byte b1, byte b2, byte b3, byte b4) Concatenates the four parameter bytes to form an int value. **Parameters:**b1 - the first byte ( high order byte ) b2 - the second byte b3 - the third byte b4 - the fourth byte ( low order byte ) **Returns:**the int value the concatenated result ---- === makeInt === public static final int **makeInt**(short s1, short s2) Concatenates the two parameter short values to form an int value. **Parameters:**s1 - the first short value ( high order short value ) s2 - the second short value ( low order short value ) **Returns:**the int value the concatenated result ---- === getInt === public static final int **getInt**(byte[] bArray, short bOff) throws [[javacard:java-card-api:NullPointerException|NullPointerException]] , [[javacard:java-card-api:ArrayIndexOutOfBoundsException|ArrayIndexOutOfBoundsException]] Concatenates four bytes in a byte array to form a int value. **Parameters:**bArray - byte array bOff - offset within byte array containing first byte (the high order byte) **Returns:**the int value the concatenated result **Throws:** [[javacard:java-card-api:NullPointerException|NullPointerException]] - if the bArray parameter is null [[javacard:java-card-api:ArrayIndexOutOfBoundsException|ArrayIndexOutOfBoundsException]] - if the bOff parameter is negative or if bOff+4 is greater than the length of bArray ---- === setInt === public static final short **setInt**(byte[] bArray, short bOff, int iValue) throws [[javacard:java-card-api:TransactionException|TransactionException]] , [[javacard:java-card-api:NullPointerException|NullPointerException]] , [[javacard:java-card-api:ArrayIndexOutOfBoundsException|ArrayIndexOutOfBoundsException]] Deposits the int value as four successive bytes at the specified offset in the byte array. **Parameters:**bArray - byte array bOff - offset within byte array to deposit the first byte (the high order byte) iValue - the short value to set into array. **Returns:**bOff+4 Note: \\ *//If the byte array is persistent, this operation is performed atomically. If the commit capacity is exceeded, no operation is performed and a //TransactionException// exception is thrown.// \\ **Throws:** [[javacard:java-card-api:TransactionException|TransactionException]] - if the operation would cause the commit capacity to be exceeded [[javacard:java-card-api:NullPointerException|NullPointerException]] - if the bArray parameter is null [[javacard:java-card-api:ArrayIndexOutOfBoundsException|ArrayIndexOutOfBoundsException]] - if the bOff parameter is negative or if bOff+4 is greater than the length of bArray **See Also:**[[javacard:java-card-api:JCSystem#getUnusedCommitCapacity()|javacard.framework.JCSystem.getUnusedCommitCapacity()]] ---- === makeTransientIntArray === public static int[] **makeTransientIntArray**(short length, byte event) throws [[javacard:java-card-api:NegativeArraySizeException|NegativeArraySizeException]] , [[javacard:java-card-api:SystemException|SystemException]] Creates a transient int array with the specified array length. **Parameters:**length - the length of the int array event - the CLEAR_ON... event which causes the array elements to be cleared **Returns:**the new transient int array **Throws:** [[javacard:java-card-api:NegativeArraySizeException|NegativeArraySizeException]] - if the length parameter is negative [[javacard:java-card-api:SystemException|SystemException]] - 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. \\ **See Also:**[[javacard:java-card-api:JCSystem|javacard.framework.JCSystem]]