Class Utils


  • final class Utils
    extends java.lang.Object
    A set of utility methods.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static byte[] BYTE_ZEROES  
      private static int[] INT_ZEROES  
    • Constructor Summary

      Constructors 
      Constructor Description
      Utils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static void fillWithZeroes​(byte[] dest, int offset, int length)
      Fills byte array with zeroes.
      (package private) static void fillWithZeroes​(int[] dest, int offset, int length)
      Fills int array with zeroes.
      • Methods inherited from class java.lang.Object

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

      • BYTE_ZEROES

        private static final byte[] BYTE_ZEROES
      • INT_ZEROES

        private static final int[] INT_ZEROES
    • Constructor Detail

      • Utils

        Utils()
    • Method Detail

      • fillWithZeroes

        static void fillWithZeroes​(byte[] dest,
                                   int offset,
                                   int length)
        Fills byte array with zeroes.

        Current implementation uses System.arraycopy(java.lang.Object, int, java.lang.Object, int, int), so it should be used for length not less than 16.

        Parameters:
        dest - array to fill with zeroes
        offset - the first byte to fill
        length - number of bytes to change
      • fillWithZeroes

        static void fillWithZeroes​(int[] dest,
                                   int offset,
                                   int length)
        Fills int array with zeroes.

        Current implementation uses System.arraycopy(java.lang.Object, int, java.lang.Object, int, int), so it should be used for length not less than 16.

        Parameters:
        dest - array to fill with zeroes
        offset - the first item to fill
        length - number of item to change