Class Ints


  • @ParametersAreNonnullByDefault
    public final class Ints
    extends Object
    Static utility methods related to int and Integer.
    • Method Detail

      • toBytes

        @Nonnull
        public static byte[] toBytes​(int value)
        Encodes an int to a byte array.
        Parameters:
        value - the value to encode
        Returns:
        a byte array
      • toBytes

        @Nonnull
        public static byte[] toBytes​(Integer value)
        Encodes an Integer to a byte array.
        Parameters:
        value - the value to encode
        Returns:
        a byte array
        Throws:
        NullPointerException - if the value is null