Provides a wrapper around a stream that locks the stream during concurrent access.
public class LockingStreamWrapper : IDisposable
Gets the length of the wrapped stream without locking it.
Gets the wrapped stream and locks access until it's disposed. The returned stream should be disposed after use as soon as possible.