📄 bignumber.html
字号:
<TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javacardx/framework/math/BigNumber.html#setMaximum(byte[], short, short, byte)">setMaximum</A></B>(byte[] maxValue, short bOff, short bLen, byte arrayFormat)</CODE><BR> Sets the maximum value that the BigNumber may contain.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javacardx/framework/math/BigNumber.html#subtract(byte[], short, short, byte)">subtract</A></B>(byte[] bArray, short bOff, short bLen, byte arrayFormat)</CODE><BR> Decrements the internal big number by the specified operand value</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javacardx/framework/math/BigNumber.html#toBytes(byte[], short, short, byte)">toBytes</A></B>(byte[] outBuf, short bOff, short numBytes, byte arrayFormat)</CODE><BR> Writes the internal big number out in the desired format.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="../../../java/lang/Object.html" title="class in java.lang">Object</A></B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../java/lang/Object.html#equals(java.lang.Object)">equals</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_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>Field Detail</B></FONT></TH></TR></TABLE><A NAME="FORMAT_BCD"><!-- --></A><H3>FORMAT_BCD</H3><PRE>public static final byte <B>FORMAT_BCD</B></PRE><DL><DD>Constant to indicate a BCD (binary coded decimal) data format. When this format is used a binary coded decimal digit is stored in 1 nibble (4 bits). A byte is packed with 2 BCD digits.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javacardx.framework.math.BigNumber.FORMAT_BCD">Constant Field Values</A></DL></DL><HR><A NAME="FORMAT_HEX"><!-- --></A><H3>FORMAT_HEX</H3><PRE>public static final byte <B>FORMAT_HEX</B></PRE><DL><DD>Constant to indicate a hexadecimal (simple binary) data format.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javacardx.framework.math.BigNumber.FORMAT_HEX">Constant Field Values</A></DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_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>Constructor Detail</B></FONT></TH></TR></TABLE><A NAME="BigNumber(short)"><!-- --></A><H3>BigNumber</H3><PRE>public <B>BigNumber</B>(short maxBytes)</PRE><DL><DD>Creates a BigNumber instance with initial value 0. All implementations must support at least 8 byte length internal representation capacity.<P><DL><DT><B>Parameters:</B><DD><CODE>maxBytes</CODE> - maximum number of bytes needed in the hexadecimal format for the largest unsigned big number. For example, maxBytes = 2 allows a big number representation range 0-65535.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArithmeticException.html" title="class in java.lang">ArithmeticException</A></CODE> - if maxBytes is 0, negative or larger than the supported maximum</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="setMaximum(byte[], short, short, byte)"><!-- --></A><H3>setMaximum</H3><PRE>public void <B>setMaximum</B>(byte[] maxValue, short bOff, short bLen, byte arrayFormat)</PRE><DL><DD>Sets the maximum value that the BigNumber may contain. Attempts to increase beyond the maximum results in an exception. If this method is not called, the maximum value is the maximum hex value that fits within the configured maximum number of bytes. <p>Note:<ul> <li><em>This method may allocate internal storage to store the specified maximum value.</em> </ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>maxValue</CODE> - input byte array<DD><CODE>bOff</CODE> - offset within input byte array containing first byte (the high order byte)<DD><CODE>bLen</CODE> - byte length of input data<DD><CODE>arrayFormat</CODE> - indicates the format of the input data. Valid codes listed in <code>FORMAT_*</code> constants. See <A HREF="../../../javacardx/framework/math/BigNumber.html#FORMAT_BCD"><CODE>FORMAT_BCD</CODE></A>.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if <code>maxValue</code> is <code>null</code><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/ArithmeticException.html" title="class in java.lang">ArithmeticException</A></CODE> - for the following conditions:<ul> <li>if the specified maximum value is smaller than the encapsulated big number <li>if the specified maximum value is larger than will fit within the supported maximum number of bytes <li>if the input byte array format is not conformant with the specified <code>arrayFormat</code> parameter <li>if <code>bLen</code> is 0 <li>if <code>arrayFormat</code> is not one of the FORMAT_ constants. </ul></DL></DD></DL><HR><A NAME="getMaxBytesSupported()"><!-- --></A><H3>getMaxBytesSupported</H3><PRE>public static short <B>getMaxBytesSupported</B>()</PRE><DL><DD>This method returns the byte length of the hex array that can store the biggest BigNumber supported. This number is the maximum number in hex byte representation. All implementations must support at least 8 bytes.<P><DD><DL><DT><B>Returns:</B><DD>the byte length of the biggest number supported</DL></DD></DL><HR><A NAME="init(byte[], short, short, byte)"><!-- --></A><H3>init</H3><PRE>public void <B>init</B>(byte[] bArray, short bOff, short bLen, byte arrayFormat) 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>, <A HREF="../../../java/lang/ArithmeticException.html" title="class in java.lang">ArithmeticException</A></PRE><DL><DD>Initializes the big number using the input data<P><DD><DL><DT><B>Parameters:</B><DD><CODE>bArray</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 data<DD><CODE>arrayFormat</CODE> - indicates the format of the input data. Valid codes listed in <code>FORMAT_*</code> constants. See <A HREF="../../../javacardx/framework/math/BigNumber.html#FORMAT_BCD"><CODE>FORMAT_BCD</CODE></A>.<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 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>bArray</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 conformant with the specified <code>arrayFormat</code> parameter <li>if the specified input data represents a number which is larger than the maximum value configured or larger than will fit within the supported maximum number of bytes <li>if <code>bLen</code> is 0 <li>if <code>arrayFormat</code> is not one of the FORMAT_ constants. </ul></DL></DD></DL><HR><A NAME="add(byte[], short, short, byte)"><!-- --></A><H3>add</H3><PRE>public void <B>add</B>(byte[] bArray, short bOff, short bLen, byte arrayFormat) 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>, <A HREF="../../../java/lang/ArithmeticException.html" title="class in java.lang">ArithmeticException</A></PRE><DL><DD>Increments the internal big number by the specified operand value<P><DD><DL><DT><B>Parameters:</B><DD><CODE>bArray</CODE> - input byte array<DD><CODE>bOff</CODE> - offset within input byte array containing first byte (the high order byte)<DD><CODE>bLen</CODE> - byte length of input data<DD><CODE>arrayFormat</CODE> - indicates the format of the input data. Valid codes listed in <code>FORMAT_*</code> constants. See <A HREF="../../../javacardx/framework/math/BigNumber.html#FORMAT_BCD"><CODE>FORMAT_BCD</CODE></A>.<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>bArray</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 conformant with the specified <code>arrayFormat</code> parameter <li>if the result of the addition results in a big number which cannot be represented within the maximum supported bytes or is greater than the configured max value. The internal big number is left unchanged. <li>if <code>bLen</code> is 0 <li>if <code>arrayFormat</code> is not one of the FORMAT_ constants </ul></DL></DD></DL><HR><A NAME="subtract(byte[], short, short, byte)"><!-- --></A><H3>subtract</H3>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -