Package org.jose4j.lang
Class ByteUtil
java.lang.Object
org.jose4j.lang.ByteUtil
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
bitLength
(byte[] bytes) static int
bitLength
(int byteLength) static int
byteLength
(int numberOfBits) static byte[]
concat
(byte[]... byteArrays) static int[]
convertSignedTwosCompToUnsigned
(byte[] bytes) static byte[]
convertUnsignedToSignedTwosComp
(int[] ints) static byte
getByte
(int intValue) static byte[]
getBytes
(int intValue) static byte[]
getBytes
(long longValue) static int
getInt
(byte b) static byte[]
leftHalf
(byte[] inputBytes) static byte[]
randomBytes
(int length) static byte[]
randomBytes
(int length, SecureRandom secureRandom) static byte[]
reverse
(byte[] in) static byte[]
rightHalf
(byte[] inputBytes) static boolean
secureEquals
(byte[] bytes1, byte[] bytes2) static byte[]
subArray
(byte[] inputBytes, int startPos, int length) static String
toDebugString
(byte[] bytes)
-
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
-
randomBytes
public static byte[] randomBytes(int length) -
toDebugString
-