Top Fields Constructors Methods
ch.randelshofer.fastdoubleparser

pack-priv Class JavaBigIntegerFromByteArray

extends AbstractNumberParser
Class Inheritance
Imports
java.math.BigInteger, java.nio.charset.StandardCharsets, java.util.Map

Field Summary

Modifier and TypeField and Description
private static final int
MAX_DECIMAL_DIGITS

The resulting value must fit into 2^31 - 1 bits.

private static final int
MAX_HEX_DIGITS

The resulting value must fit into 2^31 - 1 bits.

public static final int
Inherited from ch.randelshofer.fastdoubleparser.AbstractNumberParser:
CHAR_TO_HEX_MAPDECIMAL_POINT_CLASSILLEGAL_OFFSET_OR_ILLEGAL_LENGTHOTHER_CLASSSYNTAX_ERRORVALUE_EXCEEDS_LIMITS

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public BigInteger

Returns:

the parsed value (always non-null)
parseBigIntegerLiteral
(byte[]
the input string
str
,
int
the start of the string
offset
,
int
the length of the string
length
,
int
the radix of the number
radix
)

Parses a BigIntegerLiteral as specified in JavaBigIntegerParser.

private BigInteger
parseDecDigits(byte[] str, int from, int to, boolean isNegative)

private BigInteger
parseHexDigits(byte[] str, int from, int to, boolean isNegative)

private BigInteger
parseManyDecDigits(byte[] str, int from, int to, boolean isNegative)

private int
skipZeroes(byte[] str, int from, int to)

Inherited from ch.randelshofer.fastdoubleparser.AbstractNumberParser:
charAtcharAtcharAtlookupHexlookupHex

Field Detail

MAX_DECIMAL_DIGITSback to summary
private static final int MAX_DECIMAL_DIGITS

The resulting value must fit into 2^31 - 1 bits. The decimal representation of 2^31 - 1 has 646,456,993 digits.

MAX_HEX_DIGITSback to summary
private static final int MAX_HEX_DIGITS

The resulting value must fit into 2^31 - 1 bits. The hexadecimal representation of 2^31 - 1 has 536870912 digits.

MAX_INPUT_LENGTHback to summary
public static final int MAX_INPUT_LENGTH

Constructor Detail

JavaBigIntegerFromByteArrayback to summary
pack-priv JavaBigIntegerFromByteArray()

Method Detail

parseBigIntegerLiteralback to summary
public BigInteger parseBigIntegerLiteral(byte[] str, int offset, int length, int radix) throws NumberFormatException

Parses a BigIntegerLiteral as specified in JavaBigIntegerParser.

Parameters
str:byte[]

the input string

offset:int

the start of the string

length:int

the length of the string

radix:int

the radix of the number

Returns:BigInteger

the parsed value (always non-null)

Exceptions
NumberFormatException:
if parsing fails
parseDecDigitsback to summary
private BigInteger parseDecDigits(byte[] str, int from, int to, boolean isNegative)
parseHexDigitsback to summary
private BigInteger parseHexDigits(byte[] str, int from, int to, boolean isNegative)
parseManyDecDigitsback to summary
private BigInteger parseManyDecDigits(byte[] str, int from, int to, boolean isNegative)
skipZeroesback to summary
private int skipZeroes(byte[] str, int from, int to)