Class ArrayUtils

java.lang.Object
net.lenni0451.imnbt.utils.ArrayUtils

public class ArrayUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static byte[]
    insert(byte[] array, int index, byte b)
    Insert a byte into an array at the given index.
    static int[]
    insert(int[] array, int index, int i)
    Insert an int into an array at the given index.
    static long[]
    insert(long[] array, int index, long l)
    Insert a long into an array at the given index.
    static byte[]
    remove(byte[] array, int index)
    Remove a byte from an array at the given index.
    static int[]
    remove(int[] array, int index)
    Remove an int from an array at the given index.
    static long[]
    remove(long[] array, int index)
    Remove a long from an array at the given index.

    Methods inherited from class java.lang.Object

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

    • ArrayUtils

      public ArrayUtils()
  • Method Details

    • remove

      public static byte[] remove(byte[] array, int index)
      Remove a byte from an array at the given index.
      Parameters:
      array - The array to remove the byte from
      index - The index of the byte to remove
      Returns:
      The new array without the byte
    • insert

      public static byte[] insert(byte[] array, int index, byte b)
      Insert a byte into an array at the given index.
      Parameters:
      array - The array to insert the byte into
      index - The index to insert the byte at
      b - The byte to insert
      Returns:
      The new array with the byte inserted
    • remove

      public static int[] remove(int[] array, int index)
      Remove an int from an array at the given index.
      Parameters:
      array - The array to remove the int from
      index - The index of the int to remove
      Returns:
      The new array without the int
    • insert

      public static int[] insert(int[] array, int index, int i)
      Insert an int into an array at the given index.
      Parameters:
      array - The array to insert the int into
      index - The index to insert the int at
      i - The int to insert
      Returns:
      The new array with the int inserted
    • remove

      public static long[] remove(long[] array, int index)
      Remove a long from an array at the given index.
      Parameters:
      array - The array to remove the long from
      index - The index of the long to remove
      Returns:
      The new array without the long
    • insert

      public static long[] insert(long[] array, int index, long l)
      Insert a long into an array at the given index.
      Parameters:
      array - The array to insert the long into
      index - The index to insert the long at
      l - The long to insert
      Returns:
      The new array with the long inserted