/// <summary> /// Sets the length of the stream. /// </summary> /// <param name="value">The new length</param> public override void SetLength(long value) { CheckFrozen(); if (_diffStream != null) { _diffStream.SetLength(value); } else { _baseStream.SetLength(value); } }
/// <summary> /// Takes a snapshot of the current stream contents. /// </summary> public void Snapshot() { if (_diffStream != null) { throw new InvalidOperationException("Already have a snapshot"); } _savedPosition = _position; _diffExtents = new List <StreamExtent>(); _diffStream = new SparseMemoryStream(); _diffStream.SetLength(_baseStream.Length); }
/// <summary> /// Takes a snapshot of the current stream contents. /// </summary> public void Snapshot() { if (_diffStream != null) { throw new InvalidOperationException("Already have a snapshot"); } _savedPosition = _position; _diffExtents = new List<StreamExtent>(); _diffStream = new SparseMemoryStream(); _diffStream.SetLength(_baseStream.Length); }