public static byte[] copyOfRange(final byte[] original, final int from, final int count) {
        return Arrays.copyOfRange(original, from, from + Allocator.checkByteArray(count));
    }
Copies the specified range of the specified array into a new array.

@param original the array from which a range is to be copied.
@param from     the initial index of the range to be copied, inclusive.
@param count    the amount of bytes to copy.
@return a new array containing the specified range from the original array, truncated or padded with zeros to obtain the required length.
src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java