CacheIndexInputTest.writeRandomData(size, random, output, cacheIndexOutput);
output.close();
cacheIndexOutput.close();
IndexInput input = directory.openInput(name, IOContext.DEFAULT);
IndexInput testInput = directory2.openInput(name, IOContext.DEFAULT);
CacheIndexInputTest.readRandomData(input, testInput, random, sampleSize, maxBufSize, maxOffset);
testInput.close();
input.close();
directory.close();
directory2.close();