Package ej.websocket.util
Class ArraysTools
- java.lang.Object
-
- ej.websocket.util.ArraysTools
-
public class ArraysTools extends Object
Classes providing basic tools to handle array.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]add(byte[] array, int arrayOffset, int arrayLength, byte[] other, int otherOffset, int otherLength)Appends two arrays into a new one.static byte[]insertRange(byte[] array, int offset, int length)Inserts a range of data in an array.static byte[]removeRange(byte[] array, int offset, int length)Removes a range of data in an array.
-
-
-
Method Detail
-
removeRange
public static byte[] removeRange(byte[] array, int offset, int length)Removes a range of data in an array.- Parameters:
array- the array to remove the data.offset- the offset of the first element to removelength- the number of element to remove.- Returns:
- a new array.
-
insertRange
public static byte[] insertRange(byte[] array, int offset, int length)Inserts a range of data in an array.- Parameters:
array- the array to insert the data.offset- the offset of the place to insert the data.length- the number of element to insert.- Returns:
- a new array.
-
add
public static byte[] add(byte[] array, int arrayOffset, int arrayLength, byte[] other, int otherOffset, int otherLength)Appends two arrays into a new one.- Parameters:
array- the first array.arrayOffset- the first array offset to start from.arrayLength- the length to take from the first array.other- the second array.otherOffset- the second array offset to start from.otherLength- the length to take from the second array.- Returns:
- a new array.
-
-