/// <summary> /// Replaces the content of the memory mapped file with a write lock in place. /// </summary> public void Write(byte[] data) { if (data is null) { throw new ArgumentNullException(nameof(data)); } if (data.Length > MaxFileSize) { throw new ArgumentOutOfRangeException(nameof(data), "Length greater than max file size"); } readWriteLock.AcquireWriteLock(); try { InternalWrite(data); } finally { readWriteLock.ReleaseWriteLock(); fileWaitHandle.Set(); fileWaitHandle.Reset(); } }
/// <summary> /// Replaces the content of the memory mapped file with a write lock in place. /// </summary> public void Write(byte[] data) { if (data.Length > maxFileSize) { throw new ArgumentOutOfRangeException(nameof(data), "Length greater than max file size"); } readWriteLock.AcquireWriteLock(); try { InternalWrite(data); } finally { readWriteLock.ReleaseWriteLock(); } }