📄 bcdutil.html
字号:
<PRE>public <B>BCDUtil</B>()</PRE><DL></DL><!-- ============ 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="getMaxBytesSupported()"><!-- --></A><H3>getMaxBytesSupported</H3><PRE>public static short <B>getMaxBytesSupported</B>()</PRE><DL><DD>This method returns the largest value that can be used with the BCD utility functions. This number represents the the byte length of the largest value in hex byte representation. All implementations must support at least 8 byte length usage capacity.<P><DD><DL><DT><B>Returns:</B><DD>the byte length of the largest hex value supported</DL></DD></DL><HR><A NAME="convertToHex(byte[], short, short, byte[], short)"><!-- --></A><H3>convertToHex</H3><PRE>public static short <B>convertToHex</B>(byte[] bcdArray, short bOff, short bLen, byte[] hexArray, short outOff)</PRE><DL><DD>Converts the input BCD data into hexadecimal format. <p> Note:<ul> <li><em>If </em><code>bOff</code><em> or </em><code>bLen</code><em> or </em><code>outOff</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>bcdArray.length</code><em>, the length of the </em><code>bcdArray</code><em> array a </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown and no conversion is performed.</em> <li><em>If the output bytes need to be written at an offset greater than </em><code>hexArray.length</code><em>, the length of the </em><code>hexArray</code><em> array an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown and no conversion is performed.</em> <li><em>If </em><code>bcdArray</code><em> or </em><code>hexArray</code><em> parameter is </em><code>null</code><em> a </em><code>NullPointerException</code><em> exception is thrown.</em> <li><em>If the <code>bcdArray</code> and <code>hexArray</code> arguments refer to the same array object, then the conversion is performed as if the components at positions </em><code>bOff</code><em> through </em><code>bOff+bLen-1</code><em> were first copied to a temporary array with </em><code>bLen</code><em> components and then the contents of the temporary array were converted into positions </em><code>outOff</code><em> onwards for the converted bytes of the output array.</em> </ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>bcdArray</CODE> - input byte array<DD><CODE>bOff</CODE> - offset within byte array containing first byte (the high order byte)<DD><CODE>bLen</CODE> - byte length of input BCD data<DD><CODE>hexArray</CODE> - output byte array<DD><CODE>outOff</CODE> - offset within hexArray where output data begins<DT><B>Returns:</B><DD>the byte length of the output hexadecimal data<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A></CODE> - if converting would cause access of data outside array bounds or if <code>bLen</code> is negative<DD><CODE><A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if either <code>bcdArray</code> or <code>hexArray</code> is <code>null</code><DD><CODE><A HREF="../../../java/lang/ArithmeticException.html" title="class in java.lang">ArithmeticException</A></CODE> - for the following conditions:<ul> <li>if the input byte array format is not a correctly formed BCD value <li>the size of the BCD value requires greater than supported maximum number of bytes to represent in hex format <li>if <code>bLen</code> is 0 </ul></DL></DD></DL><HR><A NAME="convertToBCD(byte[], short, short, byte[], short)"><!-- --></A><H3>convertToBCD</H3><PRE>public static short <B>convertToBCD</B>(byte[] hexArray, short bOff, short bLen, byte[] bcdArray, short outOff)</PRE><DL><DD>Converts the input hexadecimal data into BCD format. The output data is right justified. If the number of output BCD nibbles is odd, the first BCD nibble written is 0. <p>Note:<ul> <li><em>If </em><code>bOff</code><em> or </em><code>bLen</code><em> or </em><code>outOff</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>hexArray.length</code><em>, the length of the </em><code>hexArray</code><em> array a </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown and no conversion is performed.</em> <li><em>If the output bytes need to be written at an offset greater than </em><code>bcdArray.length</code><em>, the length of the </em><code>bcdArray</code><em> array an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown and no conversion is performed.</em> <li><em>If </em><code>bcdArray</code><em> or </em><code>hexArray</code><em> parameter is </em><code>null</code><em> a </em><code>NullPointerException</code><em> exception is thrown.</em> <li><em>If the <code>bcdArray</code> and <code>hexArray</code> arguments refer to the same array object, then the conversion is performed as if the components at positions </em><code>bOff</code><em> through </em><code>bOff+bLen-1</code><em> were first copied to a temporary array with </em><code>bLen</code><em> components and then the contents of the temporary array were converted into positions </em><code>outOff</code><em> onwards for the converted bytes of the output array.</em></ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>hexArray</CODE> - input byte array<DD><CODE>bOff</CODE> - offset within byte array containing first byte (the high order byte)<DD><CODE>bLen</CODE> - byte length of input hex data<DD><CODE>bcdArray</CODE> - output byte array<DD><CODE>outOff</CODE> - offset within bcdArray where output data begins<DT><B>Returns:</B><DD>the byte length of the output bcd formatted data<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A></CODE> - if converting would cause access of data outside array bounds or if <code>bLen</code> is negative<DD><CODE><A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if either <code>bcdArray</code> or <code>hexArray</code> is <code>null</code><DD><CODE><A HREF="../../../java/lang/ArithmeticException.html" title="class in java.lang">ArithmeticException</A></CODE> - for the following conditions:<ul> <li>if the length of the input hex value is larger than the supported maximum number of bytes <li>if <code>bLen</code> is 0</ul></DL></DD></DL><HR><A NAME="isBCDFormat(byte[], short, short)"><!-- --></A><H3>isBCDFormat</H3><PRE>public static boolean <B>isBCDFormat</B>(byte[] bcdArray, short bOff, short bLen)</PRE><DL><DD>Checks if the input data is in BCD format. Note that this method does not enforce an upper bound on the length of the input BCD value.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>bcdArray</CODE> - input byte array<DD><CODE>bOff</CODE> - offset within byte array containing first byte (the high order byte)<DD><CODE>bLen</CODE> - byte length of input BCD data<DT><B>Returns:</B><DD>true if input data is in BCD format, false otherwise<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A></CODE> - if accessing the input array would cause access of data outside array bounds or if <code>bLen</code> is negative<DD><CODE><A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if <code>bcdArray</code> is <code>null</code><DD><CODE><A HREF="../../../java/lang/ArithmeticException.html" title="class in java.lang">ArithmeticException</A></CODE> - if <code>bLen</code> is 0</ul></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/BCDUtil.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"> PREV CLASS <A HREF="../../../javacardx/framework/math/BigNumber.html" title="class in javacardx.framework.math"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?javacardx/framework/math/BCDUtil.html" target="_top"><B>FRAMES</B></A> <A HREF="BCDUtil.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 | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <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 + -