Class UnsignedNumberUtil

java.lang.Object
io.protostuff.UnsignedNumberUtil

public final class UnsignedNumberUtil extends Object
  • Field Details

  • Method Details

    • parseUnsignedInt

      public static int parseUnsignedInt(String s)
      Returns the unsigned int value represented by the given decimal string.
      Throws:
      NumberFormatException - if the string does not contain a valid unsigned int value
      NullPointerException - if s is null (in contrast to Integer.parseInt(String))
    • unsignedIntToString

      public static String unsignedIntToString(int x)
      Returns a string representation of x, where x is treated as unsigned.
    • parseUnsignedLong

      public static long parseUnsignedLong(String s)
      Returns the unsigned long value represented by the given decimal string.
      Throws:
      NumberFormatException - if the string does not contain a valid unsigned long value
      NullPointerException - if s is null (in contrast to Long.parseLong(String))
    • unsignedLongToString

      public static String unsignedLongToString(long x)
      Returns a string representation of x, where x is treated as unsigned.