A circular ring buffer of bytes
 /// <summary>
 /// Create a new instance of <see cref="JournalWriter"/>
 /// </summary>
 /// <param name="bufferSize">size of the buffer, IOs will be writen to disk in blocks of this size. Must be a multiple of the disk sector size.
 /// You can use the following command to determine your disk sector size: "fsutil fsinfo ntfsinfo c:"</param>
 /// <param name="blockWriter">the <see cref="IBlockWriter"/> used to write to disk.</param>
 public JournalWriter(int bufferSize, IBlockWriter blockWriter)
 {
     _blockWriter        = blockWriter;
     _buffer             = new ByteRingBuffer(bufferSize);
     _buffer.BufferFull += OnBufferFull;
 }
示例#2
0
 /// <summary>
 /// Create a new instance of <see cref="JournalWriter"/>
 /// </summary>
 /// <param name="bufferSize">size of the buffer, IOs will be writen to disk in blocks of this size. Must be a multiple of the disk sector size.
 /// You can use the following command to determine your disk sector size: "fsutil fsinfo ntfsinfo c:"</param>
 /// <param name="blockWriter">the <see cref="IBlockWriter"/> used to write to disk.</param>
 public JournalWriter(int bufferSize, IBlockWriter blockWriter)
 {
     _blockWriter = blockWriter;
     _buffer = new ByteRingBuffer(bufferSize);
     _buffer.BufferFull += OnBufferFull;
 }