All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.googlecode.mp4parser.util.Mp4Arrays Maven / Gradle / Ivy

Go to download

A generic parser and writer for all ISO 14496 based files (MP4, Quicktime, DCF, PDCF, ...)

There is a newer version: 1.1.22
Show newest version
package com.googlecode.mp4parser.util;

/**
 * Created by sannies on 02.05.2015.
 */
public final class Mp4Arrays {
    private Mp4Arrays() {
    }

    public static long[] copyOfAndAppend(long[] original, long... toAppend) {
        if (original == null) {
            original = new long[]{};
        }
        if (toAppend == null) {
            toAppend = new long[]{};
        }
        long[] copy = new long[original.length + toAppend.length];
        System.arraycopy(original, 0, copy, 0, original.length);
        System.arraycopy(toAppend, 0, copy, original.length, toAppend.length);
        return copy;
    }


    public static int[] copyOfAndAppend(int[] original, int... toAppend) {
        if (original == null) {
            original = new int[]{};
        }
        if (toAppend == null) {
            toAppend = new int[]{};
        }
        int[] copy = new int[original.length + toAppend.length];
        System.arraycopy(original, 0, copy, 0, original.length);
        System.arraycopy(toAppend, 0, copy, original.length, toAppend.length);
        return copy;
    }

    public static double[] copyOfAndAppend(double[] original, double... toAppend) {
        if (original == null) {
            original = new double[]{};
        }
        if (toAppend == null) {
            toAppend = new double[]{};
        }
        double[] copy = new double[original.length + toAppend.length];
        System.arraycopy(original, 0, copy, 0, original.length);
        System.arraycopy(toAppend, 0, copy, original.length, toAppend.length);
        return copy;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy