* @throws Exception
*/
protected void doBatch(FileInputStream input, int targetBatchNum, boolean showHeader) throws Exception {
int batchNum = -1;
VectorAccessibleSerializable vcSerializable = null;
while (input.available() > 0 && batchNum ++ < targetBatchNum) {
vcSerializable = new VectorAccessibleSerializable(DumpCat.allocator);
vcSerializable.readFromStream(input);
if (batchNum != targetBatchNum) {
VectorContainer vectorContainer = (VectorContainer) vcSerializable.get();
vectorContainer.zeroVectors();
}
}
if (batchNum < targetBatchNum) {
System.out.println(String.format("Wrong input of batch # ! Total # of batch in the file is %d. Please input a number 0..%d as batch #", batchNum+1, batchNum));
input.close();
System.exit(-1);
}
if (vcSerializable != null) {
showSingleBatch(vcSerializable, showHeader);
VectorContainer vectorContainer = (VectorContainer) vcSerializable.get();
vectorContainer.zeroVectors();
}
}