Package io.protostuff

Class NumberParser


  • public final class NumberParser
    extends java.lang.Object
    An IO utility for dealing with raw ascii bytes.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private NumberParser()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int parseInt​(byte[] buffer, int start, int length, int radix)
      Parse an ascii int from a raw buffer.
      (package private) static int parseInt​(byte[] buffer, int start, int length, int radix, boolean positive)  
      static long parseLong​(byte[] buffer, int start, int length, int radix)
      Parse an ascii long from a raw buffer.
      (package private) static long parseLong​(byte[] buffer, int start, int length, int radix, boolean positive)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NumberParser

        private NumberParser()
    • Method Detail

      • parseInt

        public static int parseInt​(byte[] buffer,
                                   int start,
                                   int length,
                                   int radix)
                            throws java.lang.NumberFormatException
        Parse an ascii int from a raw buffer.
        Throws:
        java.lang.NumberFormatException
      • parseInt

        static int parseInt​(byte[] buffer,
                            int start,
                            int length,
                            int radix,
                            boolean positive)
                     throws java.lang.NumberFormatException
        Throws:
        java.lang.NumberFormatException
      • parseLong

        public static long parseLong​(byte[] buffer,
                                     int start,
                                     int length,
                                     int radix)
                              throws java.lang.NumberFormatException
        Parse an ascii long from a raw buffer.
        Throws:
        java.lang.NumberFormatException
      • parseLong

        static long parseLong​(byte[] buffer,
                              int start,
                              int length,
                              int radix,
                              boolean positive)
                       throws java.lang.NumberFormatException
        Throws:
        java.lang.NumberFormatException