IndexOutput io = dir.createOutput(fileName, IOContext.DEFAULT);
RepeatableLongByteSequence bytesGenerator = new RepeatableLongByteSequence();
//It writes repeatable text
final int REPEATABLE_BUFFER_SIZE = 1501;
for (int i = 0; i < REPEATABLE_BUFFER_SIZE; i++) {
io.writeByte(bytesGenerator.nextByte());
}
io.flush();
assert io.length() == REPEATABLE_BUFFER_SIZE;
//Text to write on file with repeatable text