Package org.postgresql.util

# Class NumberParser

java.lang.Object
org.postgresql.util.NumberParser

public class NumberParser extends Object
Optimised byte[] to number parser.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NumberParser()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static long`
  `getFastLong(byte[] bytes, long minVal, long maxVal)`
  Optimised byte[] to number parser.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### NumberParser

    public NumberParser()

- ## Method Details

  - ### getFastLong

    public static long getFastLong(byte[] bytes, long minVal, long maxVal) throws NumberFormatException
    Optimised byte[] to number parser. This code does not handle null values, so the caller must do checkResultSet and handle null values prior to calling this function. Fraction part is discarded.
    Parameters:
      `bytes` - integer represented as a sequence of ASCII bytes
    Returns:
      The parsed number.
    Throws:
      `NumberFormatException` - If the number is invalid or the out of range for fast parsing. The value must then be parsed by another (less optimised) method.