📄 arraylogic.html
字号:
<!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="arrayCopyRepack(java.lang.Object, short, short, java.lang.Object, short)"><!-- --></A><H3>arrayCopyRepack</H3><PRE>public static final short <B>arrayCopyRepack</B>(<A HREF="../../../java/lang/Object.html" title="class in java.lang">Object</A> src, short srcOff, short srcLen, <A HREF="../../../java/lang/Object.html" title="class in java.lang">Object</A> dest, short destOff) throws <A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A>, <A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A>, <A HREF="../../../javacard/framework/TransactionException.html" title="class in javacard.framework">TransactionException</A>, <A HREF="../../../javacardx/framework/util/UtilException.html" title="class in javacardx.framework.util">UtilException</A></PRE><DL><DD>Copies data from the specified source array, beginning at the specified position, to the specified position of the destination array. Note that this method may be used to copy from an array of any primitive component - byte, short or int to another (or same) array of any primitive component - byte, short or int. If the source array primitive component size is smaller than that of the destination array, a packing conversion is performed; if the source array primitive component size is larger than that of the destination array, an unpacking operation is performed; if the source and destination arrays are of the same component type, simple copy without any repacking is performed. <p> Note:<ul> <li><em>If the source array is a byte array and the destination is a short array, then pairs of source array bytes are concatenated (high order byte component first) to form short components before being written to the destination short array. If the </em><code>srcLen</code><em> parameter is not a multiple of 2, an </em><code>UtilException</code><em> exception is thrown.</em></li> <li><em>If the source array is a byte array and the destination is an int array, 4 bytes of the source array are concatenated at a time (high order byte component first) to form int components before being written to the destination int array. If the </em><code>srcLen</code><em> parameter is not a multiple of 4, an </em><code>UtilException</code><em> exception is thrown.</em></li> <li><em>If the source array is a short array and the destination is an int array, then pairs of source array bytes are concatenated (high order short component first) to form int components before being written to the destination int array. If the </em><code>srcLen</code><em> parameter is not a multiple of 2, an </em><code>UtilException</code><em> exception is thrown.</em></li> <li><em>If the source array is a short array and the destination is a byte array, then each short component is split into 2 bytes (high order byte component first) before being written sequentially to the destination byte array.</em></li> <li><em>If the source array is a int array and the destination is a short array, then each int component is split into 2 shorts (high order short component first) before being written sequentially to the destination short array.</em></li> <li><em>If the source array is a int array and the destination is a byte array, then each int component is split into 4 bytes (high order byte component first) before being written sequentially to the destination byte array.</em></li> <li><em>If </em><code>srcOff</code><em> or </em><code>destOff</code><em> or </em><code>srcLen</code><em> parameter is negative an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em></li> <li><em>If </em><code>srcOff+srcLen</code><em> is greater than </em><code>src.length</code><em>, the length of the </em><code>src</code><em> array a </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown and no copy is performed.</em></li> <li><em>If offset into the </em><code>dest</code><em> array would become greater than </em><code>dest.length</code><em>, the length of the </em><code>dest</code><em> array during the copy operation </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown and no copy is performed.</em></li> <li><em>If </em><code>src</code><em> or </em><code>dest</code><em> parameter is </em><code>null</code><em></li> a </em><code>NullPointerException</code><em> exception is thrown.</em></li> <li><em>If the <code>src</code> and <code>dest</code> arguments refer to the same array object, then the copying is performed as if the components at positions </em><code>srcOff</code><em> through </em><code>srcOff+srcLen-1</code><em> were first copied to a temporary array with </em>srcLen</code><em> components and then the contents of the temporary array were copied into positions </em><code>destOff</code><em> through </em><code>destOff+srcLen-1</code><em> of the destination array.</em></li> <li><em>If the destination array is persistent, the entire copy is performed atomically.</em></li> <li><em>The copy operation is subject to atomic commit capacity limitations. If the commit capacity is exceeded, no copy is performed and a </em><code>TransactionException</code><em> exception is thrown.</em></li> </ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>src</CODE> - source array object<DD><CODE>srcOff</CODE> - offset within source array to start copy from<DD><CODE>srcLen</CODE> - number of source component values to be copied from the source array<DD><CODE>dest</CODE> - destination array object<DD><CODE>destOff</CODE> - offset within destination array to start copy into<DT><B>Returns:</B><DD>a value of one more than the offset within the <code>dest</code> array where the last copy was performed<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A></CODE> - if copying would cause access of data outside array bounds<DD><CODE><A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if either <code>src</code> or <code>dest</code> is <code>null</code><DD><CODE><A HREF="../../../javacard/framework/TransactionException.html" title="class in javacard.framework">TransactionException</A></CODE> - if copying would cause the commit capacity to be exceeded<DD><CODE><A HREF="../../../javacardx/framework/util/UtilException.html" title="class in javacardx.framework.util">UtilException</A></CODE> - with the following reason codes:<ul> <li><code>UtilException.ILLEGAL_VALUE</code> if <code>src</code> or <code>dest</code> is not an array of primitive components, or if the <code>srcLen</code> parameter is incorrect </ul><DT><B>See Also:</B><DD><A HREF="../../../javacard/framework/JCSystem.html#getUnusedCommitCapacity()"><CODE>javacard.framework.JCSystem.getUnusedCommitCapacity()</CODE></A></DL></DD></DL><HR><A NAME="arrayCopyRepackNonAtomic(java.lang.Object, short, short, java.lang.Object, short)"><!-- --></A><H3>arrayCopyRepackNonAtomic</H3><PRE>public static final short <B>arrayCopyRepackNonAtomic</B>(<A HREF="../../../java/lang/Object.html" title="class in java.lang">Object</A> src, short srcOff, short srcLen, <A HREF="../../../java/lang/Object.html" title="class in java.lang">Object</A> dest, short destOff) throws <A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A>, <A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A>, <A HREF="../../../javacardx/framework/util/UtilException.html" title="class in javacardx.framework.util">UtilException</A></PRE><DL><DD>Non-atomically copies data from the specified source array, beginning at the specified position, to the specified position of the destination array. Note that this method may be used to copy from an array of any primitive component - byte, short or int to another (or same) array of any primitive component - byte, short or int. If the source array primitive component size is smaller than that of the destination array, a packing conversion is performed; if the source array primitive component size is larger than that of the destination array, an unpacking operation is performed; if the source and destination arrays are of the same component type, simple copy without any repacking is performed. <p>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. <p> Note:<ul> <li><em>If the source array is a byte array and the destination is a short array, then pairs of source array bytes are concatenated (high order byte component first) to form short components before being written to the destination short array. If the </em><code>srcLen</code><em> parameter is not a multiple of 2, an </em><code>UtilException</code><em> exception is thrown.</em></li> <li><em>If the source array is a byte array and the destination is an int array, 4 bytes of the source array are concatenated at a time (high order byte component first) to form int components before being written to the destination int array. If the </em><code>srcLen</code><em> parameter is not a multiple of 4, an </em><code>UtilException</code><em> exception is thrown.</em></li> <li><em>If the source array is a short array and the destination is an int array, then pairs of source array bytes are concatenated (high order short component first) to form int components before being written to the destination int array. If the </em><code>srcLen</code><em> parameter is not a multiple of 2, an </em><code>UtilException</code><em> exception is thrown.</em></li> <li><em>If the source array is a short array and the destination is a byte array, then each short component is split into 2 bytes (high order byte component first) before being written sequentially to the destination byte array.</em></li> <li><em>If the source array is a int array and the destination is a short array, then each int component is split into 2 shorts (high order short component first) before being written sequentially to the destination short array.</em></li> <li><em>If the source array is a int array and the destination is a byte array, then each int component is split into 4 bytes (high order byte component first) before being written sequentially to the destination byte array.</em></li> <li><em>If </em><code>srcOff</code><em> or </em><code>destOff</code><em> or </em><code>srcLen</code><em> parameter is negative an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em></li> <li><em>If </em><code>srcOff+srcLen</code><em> is greater than </em><code>src.length</code><em>, the length of the </em><code>src</code><em> array a </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown and no copy is performed.</em></li> <li><em>If offset into the </em><code>dest</code><em> array would become greater than </em><code>dest.length</code><em>, the length of the </em><code>dest</code><em> array during the copy operation </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown and no copy is performed.</em></li> <li><em>If </em><code>src</code><em> or </em><code>dest</code><em> parameter is </em><code>null</code><em></li> a </em><code>NullPointerException</code><em> exception is thrown.</em></li> <li><em>If the <code>src</code> and <code>dest</code> arguments refer to the same array object, then the copying is performed as if the components at positions </em><code>srcOff</code><em> through </em><code>srcOff+srcLen-1</code><em> were first copied to a temporary array with </em>srcLen</code><em> components and then the contents of the temporary array were copied into positions </em><code>destOff</code><em> through </em><code>destOff+srcLen-1</code><em> of the destination array.</em></li> </ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>src</CODE> - source array object<DD><CODE>srcOff</CODE> - offset within source array to start copy from<DD><CODE>srcLen</CODE> - number of source component values to be copied from the source array<DD><CODE>dest</CODE> - destination array object<DD><CODE>destOff</CODE> - offset within destination array to start copy into<DT><B>Returns:</B><DD>a value of one more than the offset within the <code>dest</code> array where the last copy was performed<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A></CODE> - if copying would cause access of data outside array bounds<DD><CODE><A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if either <code>src</code> or <code>dest</code> is <code>null</code><DD><CODE><A HREF="../../../javacardx/framework/util/UtilException.html" title="class in javacardx.framework.util">UtilException</A></CODE> - with the following reason codes:<ul> <li><code>UtilException.ILLEGAL_VALUE</code> if <code>src</code> or <code>dest</code> is not an array of primitive components, or if the <code>srcLen</code> parameter is incorrect </ul></DL></DD></DL><HR><A NAME="arrayFillGenericNonAtomic(java.lang.Object, short, short, java.lang.Object, short)"><!-- --></A><H3>arrayFillGenericNonAtomic</H3><PRE>public static final short <B>arrayFillGenericNonAtomic</B>(<A HREF="../../../java/lang/Object.html" title="class in java.lang">Object</A> theArray, short off, short len, <A HREF="../../../java/lang/Object.html" title="class in java.lang">Object</A> valArray, short valOff) throws <A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A>, <A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A>, <A HREF="../../../javacardx/framework/util/UtilException.html" title="class in javacardx.framework.util">UtilException</A></PRE><DL><DD>Fills the array of primitive components(non-atomically) beginning at the specified position, for the specified length with the specified value. Note that this method may be used to fill an array of any primitive component type - byte, short or int. The value used for the fill operation is itself specified using an array (<code>valArray</code>) of the same primitive component type at offset <code>valOff</code>. <p>This method does not use the transaction facility during the fill operation even if
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -