How to flatten 2D array to 1D array?

With Guava, you can use either

int[] all = Ints.concat(originalArray);

or

int[] all = Ints.concat(a, b, c);


With Java 8 you can "flatMap" the inner arrays:

int[] flatArray = Arrays.stream(originalArray)
        .flatMapToInt(Arrays::stream)
        .toArray();

or:

int[] flatArray = Stream.of(a, b, c)
        .flatMapToInt(Arrays::stream)
        .toArray();