Class ArrayUtil

java.lang.Object
com.itextpdf.io.util.ArrayUtil

public final class ArrayUtil extends Object
This file is a helper class for internal usage only. Be aware that its API and functionality may be changed in the future.
  • Constructor Details

    • ArrayUtil

      private ArrayUtil()
  • Method Details

    • shortenArray

      public static byte[] shortenArray(byte[] src, int length)
      Shortens byte array.
      Parameters:
      src - the byte array
      length - the new length of bytes array
      Returns:
      the shortened byte array
    • toIntArray

      public static int[] toIntArray(Collection<Integer> collection)
      Converts a collection to an int array.
      Parameters:
      collection - the collection
      Returns:
      the int array
    • hashCode

      public static int hashCode(byte[] a)
      Creates a hash of the given byte array.
      Parameters:
      a - the byte array
      Returns:
      the byte array
    • fillWithValue

      public static int[] fillWithValue(int[] a, int value)
      Fills an array with the given value.
      Parameters:
      a - the int array
      value - the number of a value
      Returns:
      the int array
    • fillWithValue

      public static float[] fillWithValue(float[] a, float value)
      Fills an array with the given value.
      Parameters:
      a - the float array
      value - the number of a value
      Returns:
      the float array
    • fillWithValue

      public static <T> void fillWithValue(T[] a, T value)
      Fills an array with the given value.
      Type Parameters:
      T - the type of the implementation
      Parameters:
      a - the array
      value - the value of type
    • cloneArray

      public static int[] cloneArray(int[] src)
      Clones int array.
      Parameters:
      src - the int array
      Returns:
      the int array
    • indexOf

      public static int indexOf(Object[] a, Object key)
      Gets the index of object.
      Parameters:
      a - the object array
      key - the object key
      Returns:
      the index of object