Exemple #1
0
 public override ValueTask <int> ReadAsync(Memory <byte> destination, CancellationToken cancellationToken = default(CancellationToken))
 {
     if (GetType() != typeof(GZipStream))
     {
         // GZipStream is not sealed, and a derived type may have overridden ReadAsync(byte[], int, int) prior
         // to this ReadAsync(Memory<byte>) overload being introduced.  In that case, this ReadAsync(Memory<byte>) overload
         // should use the behavior of ReadAsync(byte[],int,int) overload.
         return(base.ReadAsync(destination, cancellationToken));
     }
     else
     {
         CheckDeflateStream();
         return(_deflateStream.ReadAsyncMemory(destination, cancellationToken));
     }
 }