Integers (Bouncy Castle Library 1.85 API Specification)
Date: 2026-07-12

org.bouncycastle.util

## Class Integers

- java.lang.Object
- - org.bouncycastle.util.Integers

-     public class Integers
      extends java.lang.Object

  Utility methods and constants for ints.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `BYTES`
    `static int` | `SIZE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Integers()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `bitCount(int i)`
    `static int` | `bitLength(int i)`
    `static int` | `compare(int x, int y)`
    `static int` | `compareUnsigned(int x, int y)`
    `static int` | `highestOneBit(int i)`
    `static int` | `lowestOneBit(int i)`
    `static int` | `numberOfLeadingZeros(int i)`
    `static int` | `numberOfTrailingZeros(int i)`
    `static int` | `reverse(int i)`
    `static int` | `reverseBytes(int i)`
    `static int` | `rotateLeft(int i, int distance)`
    `static int` | `rotateRight(int i, int distance)`
    `static java.lang.Integer` | `valueOf(int value)`

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

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

- - ### Field Detail

    - #### BYTES

          public static final int BYTES

      See Also:
        Constant Field Values

    - #### SIZE

          public static final int SIZE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Integers

          public Integers()

  - ### Method Detail

    - #### bitCount

          public static int bitCount(int i)

    - #### bitLength

          public static int bitLength(int i)

    - #### compare

          public static int compare(int x,
                                    int y)

    - #### compareUnsigned

          public static int compareUnsigned(int x,
                                            int y)

    - #### highestOneBit

          public static int highestOneBit(int i)

    - #### lowestOneBit

          public static int lowestOneBit(int i)

    - #### numberOfLeadingZeros

          public static int numberOfLeadingZeros(int i)

    - #### numberOfTrailingZeros

          public static int numberOfTrailingZeros(int i)

    - #### reverse

          public static int reverse(int i)

    - #### reverseBytes

          public static int reverseBytes(int i)

    - #### rotateLeft

          public static int rotateLeft(int i,
                                       int distance)

    - #### rotateRight

          public static int rotateRight(int i,
                                        int distance)

    - #### valueOf

          public static java.lang.Integer valueOf(int value)