final File tmpFile = createTempFile("RMDTrackBuilderUnitTest", "");
final File tmpIndex = Tribble.indexFile(tmpFile);
tmpIndex.deleteOnExit();
copyFile(vcfFile, tmpFile);
final Index inMemoryIndex = builder.createIndexInMemory(tmpFile, new VCFCodec());
final LittleEndianOutputStream indexOutputStream = new LittleEndianOutputStream(new FileOutputStream(tmpIndex));
// If requested, modify the tribble file after the index. Otherwise, modify the index last.
if ( createOutOfDateIndex ) {
inMemoryIndex.write(indexOutputStream);
indexOutputStream.close();
Thread.sleep(2000);
copyFile(vcfFile, tmpFile);
}
else {
copyFile(vcfFile, tmpFile);
Thread.sleep(2000);
inMemoryIndex.write(indexOutputStream);
indexOutputStream.close();
}
return tmpFile;
} catch (IOException e) {