public static byte[] copyOfStart(final byte[] original, int count) {
        if (count > original.length) {
            count = original.length;
        }
        return copyOfRange(original, 0, count);
    }
Copies the start of the specified array into a new array.

@param original the array from which a range is to be copied.
@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