IndexOutput output = directory.createOutput(name, IOContext.DEFAULT);
writeRandomData(size, random, output);
output.close();
IndexInput input = directory.openInput(name, IOContext.DEFAULT);
IndexInput testInput = new CacheIndexInput(null, name, input.clone(), cache);
readRandomData(input, testInput, random, sampleSize, maxBufSize, maxOffset);
readRandomDataShort(input, testInput, random, sampleSize);
readRandomDataInt(input, testInput, random, sampleSize);
readRandomDataLong(input, testInput, random, sampleSize);