Class ByteUtil

java.lang.Object
org.jose4j.lang.ByteUtil

public class ByteUtil extends Object
  • Field Details

    • EMPTY_BYTES

      public static final byte[] EMPTY_BYTES
  • Constructor Details

    • ByteUtil

      public ByteUtil()
  • Method Details

    • convertUnsignedToSignedTwosComp

      public static byte[] convertUnsignedToSignedTwosComp(int[] ints)
    • convertSignedTwosCompToUnsigned

      public static int[] convertSignedTwosCompToUnsigned(byte[] bytes)
    • getByte

      public static byte getByte(int intValue)
    • getBytes

      public static byte[] getBytes(int intValue)
    • getBytes

      public static byte[] getBytes(long longValue)
    • getInt

      public static int getInt(byte b)
    • secureEquals

      public static boolean secureEquals(byte[] bytes1, byte[] bytes2)
    • concat

      public static byte[] concat(byte[]... byteArrays)
    • subArray

      public static byte[] subArray(byte[] inputBytes, int startPos, int length)
    • leftHalf

      public static byte[] leftHalf(byte[] inputBytes)
    • rightHalf

      public static byte[] rightHalf(byte[] inputBytes)
    • bitLength

      public static int bitLength(byte[] bytes)
    • bitLength

      public static int bitLength(int byteLength)
    • reverse

      public static byte[] reverse(byte[] in)
    • byteLength

      public static int byteLength(int numberOfBits)
    • randomBytes

      public static byte[] randomBytes(int length, SecureRandom secureRandom)
    • randomBytes

      public static byte[] randomBytes(int length)
    • toDebugString

      public static String toDebugString(byte[] bytes)