efficiently generate 2^n combinations (/w java) : I'm trying to generate all 2^n as efficiently as possible (and save them to an array), i.e
    0001
    0010
    0011
    etc.
where n could be up to 15.

    public static void main(String args[]) {
        final long startTime = System.nanoTime();
        final int N = 15;
        int m = (int) Math.pow(2, N) - 1;
        int[][] array = new int[m][N];
        int arrLength = array.length;

        for (int i = 0; i < arrLength; i++) {
            String str = String.format("%" + N + "s", Integer.toBinaryString(i + 1)).replace(' ', '0');
            for (int j = 0; j < N; j++) {
                array[i][j] = Character.getNumericValue(str.charAt(j));
            }
        }
        final long duration = System.nanoTime() - startTime;
        double sec = (double) duration / 1000000000.0;
        System.out.println(sec);
    }



Any suggestion on how i can do this faster?
As of now, my timer says it takes ~0.1 to ~0.12

