Package net.lenni0451.imnbt.utils
Class ArrayUtils
java.lang.Object
net.lenni0451.imnbt.utils.ArrayUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
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 fromindex- 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 intoindex- The index to insert the byte atb- 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 fromindex- 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 intoindex- The index to insert the int ati- 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 fromindex- 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 intoindex- The index to insert the long atl- The long to insert- Returns:
- The new array with the long inserted
-