📄 util.html
字号:
</ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>src</CODE> - source byte array<DD><CODE>srcOff</CODE> - offset within source byte array to start copy from<DD><CODE>dest</CODE> - destination byte array<DD><CODE>destOff</CODE> - offset within destination byte array to start copy into<DD><CODE>length</CODE> - byte length to be copied<DT><B>Returns:</B><DD><code>destOff+length</code><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<DT><B>See Also:</B><DD><A HREF="../../javacard/framework/JCSystem.html#getUnusedCommitCapacity()"><CODE>JCSystem.getUnusedCommitCapacity()</CODE></A></DL></DD></DL><HR><A NAME="arrayCopyNonAtomic(byte[], short, byte[], short, short)"><!-- --></A><H3>arrayCopyNonAtomic</H3><PRE>public static final short <B>arrayCopyNonAtomic</B>(byte[] src, short srcOff, byte[] dest, short destOff, short length) 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></PRE><DL><DD>Copies an array from the specified source array, beginning at the specified position, to the specified position of the destination array (non-atomically). <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 </em><code>srcOff</code><em> or </em><code>destOff</code><em> or </em><code>length</code><em> parameter is negative an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em> <li><em>If </em><code>srcOff+length</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><em>If </em><code>destOff+length</code><em> is greater than </em><code>dest.length</code><em>, the length of the </em><code>dest</code><em> array an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown and no copy is performed.</em> <li><em>If </em><code>src</code><em> or </em><code>dest</code><em> parameter is </em><code>null</code><em> a </em><code>NullPointerException</code><em> exception is thrown.</em> <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+length-1</code><em> were first copied to a temporary array with </em><code>length</code><em> components and then the contents of the temporary array were copied into positions </em><code>destOff</code><em> through </em><code>destOff+length-1</code><em> of the argument array.</em> <li><em>If power is lost during the copy operation and the destination array is persistent, a partially changed destination array could result.</em> <li><em>The copy </em><code>length</code><em> parameter is not constrained by the atomic commit capacity limitations.</em></ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>src</CODE> - source byte array<DD><CODE>srcOff</CODE> - offset within source byte array to start copy from<DD><CODE>dest</CODE> - destination byte array<DD><CODE>destOff</CODE> - offset within destination byte array to start copy into<DD><CODE>length</CODE> - byte length to be copied<DT><B>Returns:</B><DD><code>destOff+length</code><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><DT><B>See Also:</B><DD><A HREF="../../javacard/framework/JCSystem.html#getUnusedCommitCapacity()"><CODE>JCSystem.getUnusedCommitCapacity()</CODE></A></DL></DD></DL><HR><A NAME="arrayFillNonAtomic(byte[], short, short, byte)"><!-- --></A><H3>arrayFillNonAtomic</H3><PRE>public static final short <B>arrayFillNonAtomic</B>(byte[] bArray, short bOff, short bLen, byte bValue) 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></PRE><DL><DD>Fills the byte array (non-atomically) beginning at the specified position, for the specified length with the specified byte value. <p>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. <p> Note:<ul> <li><em>If </em><code>bOff</code><em> or </em><code>bLen</code><em> parameter is negative an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em> <li><em>If </em><code>bOff+bLen</code><em> is greater than </em><code>bArray.length</code><em>, the length of the </em><code>bArray</code><em> array an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em> <li><em>If </em><code>bArray</code><em> parameter is </em><code>null</code><em> a </em><code>NullPointerException</code><em> exception is thrown.</em> <li><em>If power is lost during the copy operation and the byte array is persistent, a partially changed byte array could result.</em> <li><em>The </em><code>bLen</code><em> parameter is not constrained by the atomic commit capacity limitations.</em></ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>bArray</CODE> - the byte array<DD><CODE>bOff</CODE> - offset within byte array to start filling bValue into<DD><CODE>bLen</CODE> - byte length to be filled<DD><CODE>bValue</CODE> - the value to fill the byte array with<DT><B>Returns:</B><DD><code>bOff+bLen</code><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A></CODE> - if the fill operation 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 bArray is <code>null</code><DT><B>See Also:</B><DD><A HREF="../../javacard/framework/JCSystem.html#getUnusedCommitCapacity()"><CODE>JCSystem.getUnusedCommitCapacity()</CODE></A></DL></DD></DL><HR><A NAME="arrayCompare(byte[], short, byte[], short, short)"><!-- --></A><H3>arrayCompare</H3><PRE>public static final byte <B>arrayCompare</B>(byte[] src, short srcOff, byte[] dest, short destOff, short length) 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></PRE><DL><DD>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. Returns the ternary result of the comparison : less than(-1), equal(0) or greater than(1). <p>Note:<ul> <li><em>If </em><code>srcOff</code><em> or </em><code>destOff</code><em> or </em><code>length</code><em> parameter is negative an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em> <li><em>If </em><code>srcOff+length</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.</em> <li><em>If </em><code>destOff+length</code><em> is greater than </em><code>dest.length</code><em>, the length of the </em><code>dest</code><em> array an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em> <li><em>If </em><code>src</code><em> or </em><code>dest</code><em> parameter is </em><code>null</code><em> a </em><code>NullPointerException</code><em> exception is thrown.</em> </ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>src</CODE> - source byte array<DD><CODE>srcOff</CODE> - offset within source byte array to start compare<DD><CODE>dest</CODE> - destination byte array<DD><CODE>destOff</CODE> - offset within destination byte array to start compare<DD><CODE>length</CODE> - byte length to be compared<DT><B>Returns:</B><DD>the result of the comparison as follows:<ul> <li> <code>0</code> if identical</li> <li> <code>-1</code> if the first miscomparing byte in source array is less than that in destination array</li> <li> <code>1</code> if the first miscomparing byte in source array is greater that that in destination array</li> </ul><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A></CODE> - if comparing all bytes 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></DL></DD></DL><HR><A NAME="makeShort(byte, byte)"><!-- --></A><H3>makeShort</H3><PRE>public static final short <B>makeShort</B>(byte b1, byte b2)</PRE><DL><DD>Concatenates the two parameter bytes to form a short value.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>b1</CODE> - the first byte ( high order byte )<DD><CODE>b2</CODE> - the second byte ( low order byte )<DT><B>Returns:</B><DD>the short value the concatenated result</DL></DD></DL><HR><A NAME="getShort(byte[], short)"><!-- --></A><H3>getShort</H3><PRE>public static final short <B>getShort</B>(byte[] bArray, short bOff) throws <A HREF="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A>, <A HREF="../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A></PRE><DL><DD>Concatenates two bytes in a byte array to form a short value.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>bArray</CODE> - byte array<DD><CODE>bOff</CODE> - offset within byte array containing first byte (the high order byte)<DT><B>Returns:</B><DD>the short value the concatenated result<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if the <CODE>bArray</CODE> parameter is <CODE>null</CODE><DD><CODE><A HREF="../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A></CODE> - if the <CODE>bOff</CODE> parameter is negative or if <CODE>bOff+2</CODE> is greater than the length of <CODE>bArray</CODE></DL></DD></DL><HR><A NAME="setShort(byte[], short, short)"><!-- --></A><H3>setShort</H3><PRE>public static final short <B>setShort</B>(byte[] bArray, short bOff, short sValue) throws <A HREF="../../javacard/framework/TransactionException.html" title="class in javacard.framework">TransactionException</A>, <A HREF="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A>, <A HREF="../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A></PRE><DL><DD>Deposits the short value as two successive bytes at the specified offset in the byte array.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>bArray</CODE> - byte array<DD><CODE>bOff</CODE> - offset within byte array to deposit the first byte (the high order byte)<DD><CODE>sValue</CODE> - the short value to set into array.<DT><B>Returns:</B><DD><code>bOff+2</code> <p>Note:<ul> <li><em>If the byte array is persistent, this operation is performed atomically. If the commit capacity is exceeded, no operation is performed and a </em><code>TransactionException</code><em> exception is thrown.</em></li></ul><DT><B>Throws:</B><DD><CODE><A HREF="../../javacard/framework/TransactionException.html" title="class in javacard.framework">TransactionException</A></CODE> - if the operation would cause the commit capacity to be exceeded<DD><CODE><A HREF="../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A></CODE> - if the <CODE>bOff</CODE> parameter is negative or if <CODE>bOff+2</CODE> is greater than the length of <CODE>bArray</CODE><DD><CODE><A HREF="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if the <CODE>bArray</CODE> parameter is <CODE>null</CODE><DT><B>See Also:</B><DD><A HREF="../../javacard/framework/JCSystem.html#getUnusedCommitCapacity()"><CODE>JCSystem.getUnusedCommitCapacity()</CODE></A></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Util.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java Card </b><br><font size="-1">v2.2.2</font></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../javacard/framework/UserException.html" title="class in javacard.framework"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?javacard/framework/Util.html" target="_top"><B>FRAMES</B></A> <A HREF="Util.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><i>Copyright © 1993-2005 Sun Microsystems, Inc. 4150 Network Circle,<br>Santa Clara, CA, 95054, U.S.A. All Rights Reserved.</i></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -