Class ArrayUtil

java.lang.Object
com.viaversion.viaversion.util.ArrayUtil

public final class ArrayUtil extends Object
For type safety and effort reasons, buffer types use arrays instead of lists.

This class includes simple methods to work with these arrays in case they need to be modified (obviously being more expensive due to the required array copies for every modification).

  • Constructor Details

    • ArrayUtil

      public ArrayUtil()
  • Method Details

    • add

      public static <T> T[] add(T[] array, T element)
    • add

      @SafeVarargs public static <T> T[] add(T[] array, T... elements)
    • remove

      public static <T> T[] remove(T[] array, int index)
    • boxedArray

      public static Float[] boxedArray(float[] array)
    • boxedArray

      public static Integer[] boxedArray(int[] array)
    • boxedArray

      public static Boolean[] boxedArray(boolean[] array)