public virtual void Dispose()
        {
            try
            {
                StreamAccessLock.Wait();

                _IsDisposed = true;

                _InputStream?.Dispose();
                _InputStream = null;
            }
            finally
            {
                StreamAccessLock.Release();
            }
        }
 public virtual Windows.Foundation.IAsyncOperationWithProgress <IBuffer, uint> ReadAsync(IBuffer buffer, uint count, InputStreamOptions options)
 {
     try
     {
         StreamAccessLock.Wait();
         if (_IsDisposed)
         {
             return(AsyncInfo.Run <IBuffer, uint>((token, progress) =>
             {
                 return Task.FromResult(buffer);
             }));
         }
         _CurrentPosition += count;
         return(_InputStream.ReadAsync(buffer, count, options));
     }
     finally
     {
         StreamAccessLock.Release();
     }
 }