Class Util

java.lang.Object
io.roastedroot.zerofs.Util

final class Util extends Object
Miscellaneous static utility methods.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final int
     
    private static final int
     
    private static final int
     
    private static final char
     
    private static final byte[][]
     
    private static final byte[]
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static void
    checkNoneNull(Iterable<?> objects)
    Checks that no element in the given iterable is null, throwing NPE if any is.
    (package private) static void
    checkNotNegative(long n, 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 boolean
    isUpperCase(char c)
     
    static int
    nextPowerOf2(int n)
    Returns the next power of 2 >= n.
    (package private) static int
    smearHash(int hashCode)
     
    static String[]
    toArray(List<Name> names)
     
    static String
     
    (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.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Util

      private Util()
  • Method Details

    • nextPowerOf2

      public static int nextPowerOf2(int n)
      Returns the next power of 2 >= n.
    • checkNotNegative

      static void checkNotNegative(long n, 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(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.
    • isUpperCase

      public static boolean isUpperCase(char c)
    • toLowerCase

      public static String toLowerCase(String string)
    • toArray

      public static String[] toArray(List<Name> names)