Class ArraysTools


  • public class ArraysTools
    extends Object
    Classes providing basic tools to handle 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 remove
        length - 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.