@Test public void testDetermineDestinationOffsets_f1_BT_in() { int[][] expected_f1_BT_in_DestinationOffsets = {{0}, {3000000}, {6000000}}; int[] rowOffsets = new int[]{0, 2000, 4000}; int[] numberOfRows = new int[]{2000, 2000, 2000}; int[] sectionSizes_f1_BT_in = new int[]{3000000, 3000000, 3000000}; int[][] sourceOffsets = new int[][]{{0}, {0}, {0}}; final int[][] actual_f1_BT_in_DestinationOffsets = NcFileStitcher.determineDestinationOffsets(rowOffsets, numberOfRows, sectionSizes_f1_BT_in, sourceOffsets); for (int i = 0; i < expected_f1_BT_in_DestinationOffsets.length; i++) { assertArrayEquals(expected_f1_BT_in_DestinationOffsets[i], actual_f1_BT_in_DestinationOffsets[i]); } }
static int[][] determineDestinationOffsets(int[] rowOffsets, int[] numberOfRows, int[] sectionSizes, int[][] sourceOffsets) { int[][] destinationOffsets = new int[sectionSizes.length][]; int allSectionsSize = 0; for (int sectionSize : sectionSizes) { allSectionsSize += sectionSize; } for (int i = 0; i < sectionSizes.length; i++) { final int fileOffset = rowOffsets[i] * (sectionSizes[i] / numberOfRows[i]); destinationOffsets[i] = new int[sourceOffsets[i].length]; for (int j = 0; j < sourceOffsets[i].length; j++) { destinationOffsets[i][j] = fileOffset + j * allSectionsSize; } } return destinationOffsets; }
NcFileStitcher { static int[][] determineDestinationOffsets(int[] rowOffsets, int[] numberOfRows, int[] sectionSizes, int[][] sourceOffsets) { int[][] destinationOffsets = new int[sectionSizes.length][]; int allSectionsSize = 0; for (int sectionSize : sectionSizes) { allSectionsSize += sectionSize; } for (int i = 0; i < sectionSizes.length; i++) { final int fileOffset = rowOffsets[i] * (sectionSizes[i] / numberOfRows[i]); destinationOffsets[i] = new int[sourceOffsets[i].length]; for (int j = 0; j < sourceOffsets[i].length; j++) { destinationOffsets[i][j] = fileOffset + j * allSectionsSize; } } return destinationOffsets; } }
NcFileStitcher { static int[][] determineDestinationOffsets(int[] rowOffsets, int[] numberOfRows, int[] sectionSizes, int[][] sourceOffsets) { int[][] destinationOffsets = new int[sectionSizes.length][]; int allSectionsSize = 0; for (int sectionSize : sectionSizes) { allSectionsSize += sectionSize; } for (int i = 0; i < sectionSizes.length; i++) { final int fileOffset = rowOffsets[i] * (sectionSizes[i] / numberOfRows[i]); destinationOffsets[i] = new int[sourceOffsets[i].length]; for (int j = 0; j < sourceOffsets[i].length; j++) { destinationOffsets[i][j] = fileOffset + j * allSectionsSize; } } return destinationOffsets; }  }
NcFileStitcher { static int[][] determineDestinationOffsets(int[] rowOffsets, int[] numberOfRows, int[] sectionSizes, int[][] sourceOffsets) { int[][] destinationOffsets = new int[sectionSizes.length][]; int allSectionsSize = 0; for (int sectionSize : sectionSizes) { allSectionsSize += sectionSize; } for (int i = 0; i < sectionSizes.length; i++) { final int fileOffset = rowOffsets[i] * (sectionSizes[i] / numberOfRows[i]); destinationOffsets[i] = new int[sourceOffsets[i].length]; for (int j = 0; j < sourceOffsets[i].length; j++) { destinationOffsets[i][j] = fileOffset + j * allSectionsSize; } } return destinationOffsets; }   }
NcFileStitcher { static int[][] determineDestinationOffsets(int[] rowOffsets, int[] numberOfRows, int[] sectionSizes, int[][] sourceOffsets) { int[][] destinationOffsets = new int[sectionSizes.length][]; int allSectionsSize = 0; for (int sectionSize : sectionSizes) { allSectionsSize += sectionSize; } for (int i = 0; i < sectionSizes.length; i++) { final int fileOffset = rowOffsets[i] * (sectionSizes[i] / numberOfRows[i]); destinationOffsets[i] = new int[sourceOffsets[i].length]; for (int j = 0; j < sourceOffsets[i].length; j++) { destinationOffsets[i][j] = fileOffset + j * allSectionsSize; } } return destinationOffsets; }    }