Class Arrays


  • public final class Arrays
    extends Object
    General array utilities.
    • Method Detail

      • copyOfRange

        public static byte[] copyOfRange​(byte[] data,
                                         int from,
                                         int to)
        Make a copy of a range of bytes from the passed in data array. The range can extend beyond the end of the input array, in which case the return array will be padded with zeroes.
        Parameters:
        data - the array from which the data is to be copied.
        from - the start index at which the copying should take place.
        to - the final index of the range (exclusive).
        Returns:
        a new byte array containing the range given.