Lucene.Net.Store.TestNRTCachingDirectory.CreateSequenceFile C# (CSharp) Method

CreateSequenceFile() private method

Creates a file of the specified size with sequential data. The first byte is written as the start byte provided. All subsequent bytes are computed as start + offset where offset is the number of the byte.
private CreateSequenceFile ( Directory dir, string name, sbyte start, int size ) : void
dir Directory
name string
start sbyte
size int
return void
        private void CreateSequenceFile(Directory dir, string name, sbyte start, int size)
        {
            IndexOutput os = dir.CreateOutput(name, NewIOContext(Random()));
            for (int i = 0; i < size; i++)
            {
                os.WriteByte((byte)start);
                start++;
            }
            os.Dispose();
        }
    }