1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
4 
5 namespace System.IO.Compression
6 {
7     internal static partial class BrotliUtils
8     {
9         public const int WindowBits_Min = 10;
10         public const int WindowBits_Default = 22;
11         public const int WindowBits_Max = 24;
12         public const int Quality_Min = 0;
13         public const int Quality_Default = 11;
14         public const int Quality_Max = 11;
15         public const int MaxInputSize = int.MaxValue - 515; // 515 is the max compressed extra bytes
16 
GetQualityFromCompressionLevel(CompressionLevel level)17         internal static int GetQualityFromCompressionLevel(CompressionLevel level)
18         {
19             switch (level)
20             {
21                 case CompressionLevel.Optimal:
22                     return Quality_Default;
23                 case CompressionLevel.NoCompression:
24                     return Quality_Min;
25                 case CompressionLevel.Fastest:
26                     return 1;
27                 default:
28                     return (int)level;
29             }
30         }
31     }
32 }
33