Exemplo n.º 1
0
 protected override void Dispose(bool disposing)
 {
     if (!disposed)
     {
         try
         {
             if (disposing)
             {
                 bool repositionStream = stream?.CanSeek ?? false;
                 if (reader != null)
                 {
                     if (!reader.AbortAsync().Wait(config.ReaderAbortTimeoutMs))
                     {
                         repositionStream = false;
                     }
                 }
                 if (repositionStream)
                 {
                     stream.Position = innerStreamStartPos + totBytesRead + currShadowBufferIx;
                 }
             }
         }
         finally
         {
             base.Dispose(disposing);
             disposed = true;
         }
     }
     shadowBuffer = null;
     reader       = null;
 }