EventStore.Core.TransactionLog.Checkpoint.FileCheckpoint.Flush C# (CSharp) Method

Flush() public method

public Flush ( ) : void
return void
        public void Flush()
        {
            var last = Interlocked.Read(ref _last);
            if (last == _lastFlushed)
                return;

            _fileStream.Seek(0, SeekOrigin.Begin);
            _writer.Write(last);

            _fileStream.FlushToDisk();
            Interlocked.Exchange(ref _lastFlushed, last);
            
            OnFlushed(last);
        }

Usage Example

 public void reading_off_same_instance_gives_most_up_to_date_info()
 {
     var checkSum = new FileCheckpoint(Filename);
     checkSum.Write(0xDEAD);
     checkSum.Flush();
     var read = checkSum.Read();
     checkSum.Close();
     Assert.AreEqual(0xDEAD, read);
 }
All Usage Examples Of EventStore.Core.TransactionLog.Checkpoint.FileCheckpoint::Flush