Package com.google.common.jimfs
Class Util
- java.lang.Object
-
- com.google.common.jimfs.Util
-
final class Util extends java.lang.Object
Miscellaneous static utility methods.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
ARRAY_LEN
private static int
C1
private static int
C2
private static byte[][]
NULL_ARRAY
private static byte[]
ZERO_ARRAY
-
Constructor Summary
Constructors Modifier Constructor Description private
Util()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static void
checkNoneNull(java.lang.Iterable<?> objects)
Checks that no element in the given iterable is null, throwing NPE if any is.(package private) static void
checkNotNegative(long n, java.lang.String description)
Checks that the given number is not negative, throwing IAE if it is.(package private) static void
clear(byte[][] blocks, int off, int len)
Clears (sets to null) all blocks between off (inclusive) and off + len (exclusive) in the given array.static int
nextPowerOf2(int n)
Returns the next power of 2 >= n.(package private) static int
smearHash(int hashCode)
(package private) static void
zero(byte[] bytes, int off, int len)
Zeroes all bytes between off (inclusive) and off + len (exclusive) in the given array.
-
-
-
Field Detail
-
C1
private static final int C1
- See Also:
- Constant Field Values
-
C2
private static final int C2
- See Also:
- Constant Field Values
-
ARRAY_LEN
private static final int ARRAY_LEN
- See Also:
- Constant Field Values
-
ZERO_ARRAY
private static final byte[] ZERO_ARRAY
-
NULL_ARRAY
private static final byte[][] NULL_ARRAY
-
-
Method Detail
-
nextPowerOf2
public static int nextPowerOf2(int n)
Returns the next power of 2 >= n.
-
checkNotNegative
static void checkNotNegative(long n, java.lang.String description)
Checks that the given number is not negative, throwing IAE if it is. The given description describes the number in the exception message.
-
checkNoneNull
static void checkNoneNull(java.lang.Iterable<?> objects)
Checks that no element in the given iterable is null, throwing NPE if any is.
-
smearHash
static int smearHash(int hashCode)
-
zero
static void zero(byte[] bytes, int off, int len)
Zeroes all bytes between off (inclusive) and off + len (exclusive) in the given array.
-
clear
static void clear(byte[][] blocks, int off, int len)
Clears (sets to null) all blocks between off (inclusive) and off + len (exclusive) in the given array.
-
-