Beispiel #1
0
 public static async Task <byte[]> DecompressAsync(ReadOnlyMemory <byte> data, CompressionMethod method)
 {
     return(method switch
     {
         CompressionMethod.LZ4 => await LZ4.DecompressAsync(data).ConfigureAwait(false),
         CompressionMethod.Deflate => await Deflate.DecompressAsync(data).ConfigureAwait(false),
         CompressionMethod.Brotli => await Brotli.DecompressAsync(data).ConfigureAwait(false),
         CompressionMethod.Gzip => await Gzip.DecompressAsync(data).ConfigureAwait(false),
         _ => await Gzip.DecompressAsync(data).ConfigureAwait(false)
     });