class NcFileStitcher {

    static int[] determineSourceOffsets(int sectionSize, Variable variable) {
        int totalSize = 1;
        for (int i = 0; i < variable.getDimensions().size(); i++) {
            totalSize *= variable.getDimension(i).getLength();
        }
        final int numberOfSections = totalSize / sectionSize;
        int[] sourceOffsets = new int[numberOfSections];
        for (int i = 0; i < numberOfSections; i++) {
            sourceOffsets[i] = i * sectionSize;
        }
        return sourceOffsets;
    }

}