139 references to CompressionLevel
Microsoft.Arcade.Common (1)
ZipArchiveManager.cs (1)
25=> ZipFile.CreateFromDirectory(directoryPath, archivePath, CompressionLevel.Fastest, includeBaseDirectory);
Microsoft.AspNetCore.Components.Endpoints (1)
Builder\ResourceCollectionUrlEndpoint.cs (1)
85using (var gzipStream = new GZipStream(gzipContent, CompressionLevel.Optimal, leaveOpen: true))
Microsoft.AspNetCore.Grpc.JsonTranscoding (3)
src\aspnetcore\src\Grpc\JsonTranscoding\src\Shared\Server\MethodOptions.cs (3)
69public CompressionLevel? ResponseCompressionLevel { get; } 83CompressionLevel? responseCompressionLevel, 122CompressionLevel? responseCompressionLevel = null;
Microsoft.AspNetCore.ResponseCompression (5)
BrotliCompressionProviderOptions.cs (3)
15/// What level of compression to use for the stream. The default is <see cref="CompressionLevel.Fastest"/>. 17public CompressionLevel Level { get; set; } = CompressionLevel.Fastest;
GzipCompressionProviderOptions.cs (2)
17public CompressionLevel Level { get; set; } = CompressionLevel.Fastest;
Microsoft.AspNetCore.StaticAssets (1)
Development\StaticAssetDevelopmentRuntimeHandler.cs (1)
188using var gzipStream = new GZipStream(stream, CompressionLevel.NoCompression, leaveOpen: true);
Microsoft.Build (1)
Logging\BinaryLogger\BinaryLogger.cs (1)
404stream = new GZipStream(stream, CompressionLevel.Optimal);
Microsoft.Build.Tasks.Core (6)
ZipDirectory.cs (6)
117else if (TryParseCompressionLevel(CompressionLevel, out CompressionLevel? compressionLevel)) 151static bool TryParseCompressionLevel(string levelString, [NotNullWhen(returnValue: true)] out CompressionLevel? level) 155level = System.IO.Compression.CompressionLevel.Optimal; 159level = System.IO.Compression.CompressionLevel.Fastest; 163level = System.IO.Compression.CompressionLevel.NoCompression; 169level = System.IO.Compression.CompressionLevel.SmallestSize;
Microsoft.CodeAnalysis (4)
EmbeddedText.cs (4)
249using (var deflater = new CountingDeflateStream(builder, CompressionLevel.Optimal, leaveOpen: true)) 283using (var deflater = new CountingDeflateStream(builder, CompressionLevel.Optimal, leaveOpen: true)) 328using (var deflater = new CountingDeflateStream(builder, CompressionLevel.Optimal, leaveOpen: true)) 350public CountingDeflateStream(Stream stream, CompressionLevel compressionLevel, bool leaveOpen)
Microsoft.CodeAnalysis.Workspaces (1)
FindSymbols\Shared\AbstractSyntaxIndex_Persistence.cs (1)
166using (var gzipStream = new GZipStream(stream, CompressionLevel.Optimal, leaveOpen: true))
Microsoft.DotNet.Build.Tasks.Installers (3)
src\CreateChangelogFile.cs (1)
40using GZipStream stream = new(File.Create(ChangelogOutputPath), CompressionLevel.Optimal);
src\RpmBuilder.cs (1)
371using (GZipStream gzipStream = new(compressedPayload, CompressionLevel.Optimal, leaveOpen: true))
src\RpmPackage.cs (1)
64using GZipStream gzipStream = new(stream, CompressionLevel.Optimal, leaveOpen: true);
Microsoft.DotNet.SourceBuild.Tasks (1)
src\UsageReport\WritePackageUsageData.cs (1)
165.CreateEntry(relativePath, CompressionLevel.Optimal)
Microsoft.NET.HostModel (4)
Bundle\Bundler.cs (4)
113CompressionLevel smallestSize = (CompressionLevel)3; 114using (DeflateStream compressionStream = new DeflateStream(bundle, Enum.IsDefined(typeof(CompressionLevel), smallestSize) ? smallestSize : CompressionLevel.Optimal, leaveOpen: true))
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (1)
GZipCompress.cs (1)
81using var stream = new GZipStream(fileStream, CompressionLevel.Optimal);
Microsoft.NET.Sdk.BlazorWebAssembly.Tool (3)
Program.cs (3)
18Option<CompressionLevel> compressionLevelOption = new("-c") 20DefaultValueFactory = _ => CompressionLevel.SmallestSize, 42var c = parseResult.GetValue(compressionLevelOption);
Microsoft.NET.Sdk.StaticWebAssets.Tasks (1)
Compression\GZipCompress.cs (1)
59using var stream = new GZipStream(fileStream, CompressionLevel.Optimal);
Microsoft.NET.Sdk.StaticWebAssets.Tool (3)
Program.cs (3)
18Option<CompressionLevel> compressionLevelOption = new("-c") 20DefaultValueFactory = (_) => CompressionLevel.SmallestSize, 42var c = parseResults.GetValue(compressionLevelOption);
netstandard (1)
netstandard.cs (1)
891[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Compression.CompressionLevel))]
NuGet.Packaging (7)
PackageCreation\Authoring\PackageBuilder.cs (7)
892private ZipArchiveEntry CreateEntry(ZipArchive package, string entryName, CompressionLevel compressionLevel) 902private static ZipArchiveEntry CreatePackageFileEntry(ZipArchive package, string entryName, DateTimeOffset timeOffset, CompressionLevel compressionLevel, StringBuilder warningMessage) 930var entry = CreateEntry(package, path, CompressionLevel.Optimal); 1115var entry = CreatePackageFileEntry(package, entryName, lastWriteTime, CompressionLevel.Optimal, warningMessage); 1158ZipArchiveEntry relsEntry = CreateEntry(package, "_rels/.rels", CompressionLevel.Optimal); 1185ZipArchiveEntry relsEntry = CreateEntry(package, "[Content_Types].xml", CompressionLevel.Optimal); 1227ZipArchiveEntry packageEntry = CreateEntry(package, psmdcpPath, CompressionLevel.Optimal);
sdk-tasks (2)
ZipFileCreateFromDirectory.cs (2)
63ZipFile.CreateFromDirectory(SourceDirectory, DestinationArchive, CompressionLevel.Optimal, IncludeBaseDirectory); 98zipFile.CreateEntryFromFile(file, relativePath, CompressionLevel.Optimal);
System (1)
src\runtime\src\libraries\shims\System\ref\System.cs (1)
557[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Compression.CompressionLevel))]
System.IO.Compression (43)
System\IO\Compression\DeflateZLib\DeflateStream.cs (8)
40public DeflateStream(Stream stream, CompressionLevel compressionLevel) : this(stream, compressionLevel, leaveOpen: false) 45public DeflateStream(Stream stream, CompressionLevel compressionLevel, bool leaveOpen) : this(stream, compressionLevel, leaveOpen, ZLibNative.Deflate_DefaultWindowBits) 106internal DeflateStream(Stream stream, CompressionLevel compressionLevel, bool leaveOpen, int windowBits) 131private static ZLibNative.CompressionLevel GetZLibNativeCompressionLevel(CompressionLevel compressionLevel) => 134CompressionLevel.Optimal => ZLibNative.CompressionLevel.DefaultCompression, 135CompressionLevel.Fastest => ZLibNative.CompressionLevel.BestSpeed, 136CompressionLevel.NoCompression => ZLibNative.CompressionLevel.NoCompression, 137CompressionLevel.SmallestSize => ZLibNative.CompressionLevel.BestCompression,
System\IO\Compression\GZipStream.cs (2)
25public GZipStream(Stream stream, CompressionLevel compressionLevel) : this(stream, compressionLevel, leaveOpen: false) 30public GZipStream(Stream stream, CompressionLevel compressionLevel, bool leaveOpen)
System\IO\Compression\ZipArchive.cs (3)
285public ZipArchiveEntry CreateEntry(string entryName, CompressionLevel compressionLevel) 327public ZipArchiveEntry CreateEntry(string entryName, CompressionLevel compressionLevel, ReadOnlySpan<char> password, ZipEncryptionMethod encryptionMethod) 482private ZipArchiveEntry DoCreateEntry(string entryName, CompressionLevel? compressionLevel)
System\IO\Compression\ZipArchiveEntry.Async.cs (1)
783bool useDeflate = _compressionLevel != CompressionLevel.NoCompression;
System\IO\Compression\ZipArchiveEntry.cs (18)
50private readonly CompressionLevel _compressionLevel; 148internal ZipArchiveEntry(ZipArchive archive, string entryName, CompressionLevel compressionLevel) 152if (_compressionLevel == CompressionLevel.NoCompression) 170_compressionLevel = CompressionLevel.Optimal; 1382CompressionMethod = _compressionLevel == CompressionLevel.NoCompression 1506private static CompressionLevel MapCompressionLevel(BitFlagValues generalPurposeBitFlag, ZipCompressionMethod compressionMethod) 15140 => CompressionLevel.Optimal, 15152 => CompressionLevel.SmallestSize, 15164 => CompressionLevel.Fastest, 15176 => CompressionLevel.Fastest, 1518_ => CompressionLevel.Optimal 1523return CompressionLevel.NoCompression; 1527private static BitFlagValues MapDeflateCompressionOption(BitFlagValues generalPurposeBitFlag, CompressionLevel compressionLevel, ZipCompressionMethod compressionMethod) 1535CompressionLevel.Optimal => 0, 1536CompressionLevel.SmallestSize => 2, 1537CompressionLevel.Fastest => 6, 1538CompressionLevel.NoCompression => 6, 1808bool useDeflate = _compressionLevel != CompressionLevel.NoCompression;
System\IO\Compression\ZLibStream.cs (2)
35public ZLibStream(Stream stream, CompressionLevel compressionLevel) : this(stream, compressionLevel, leaveOpen: false) 43public ZLibStream(Stream stream, CompressionLevel compressionLevel, bool leaveOpen)
System\IO\Compression\Zstandard\ZstandardStream.Compress.cs (4)
20/// <exception cref="ArgumentOutOfRangeException"><paramref name="compressionLevel"/> is not a valid <see cref="CompressionLevel"/> value.</exception> 21public ZstandardStream(Stream stream, CompressionLevel compressionLevel) : this(stream, compressionLevel, leaveOpen: false) { } 29/// <exception cref="ArgumentOutOfRangeException"><paramref name="compressionLevel"/> is not a valid <see cref="CompressionLevel"/> value.</exception> 30public ZstandardStream(Stream stream, CompressionLevel compressionLevel, bool leaveOpen)
System\IO\Compression\Zstandard\ZstandardUtils.cs (5)
86internal static int GetQualityFromCompressionLevel(CompressionLevel compressionLevel) => 92CompressionLevel.NoCompression => Quality_Min, 93CompressionLevel.Fastest => 1, 94CompressionLevel.Optimal => Quality_Default, 95CompressionLevel.SmallestSize => Quality_Max,
System.IO.Compression.Brotli (7)
System\IO\Compression\BrotliUtils.cs (5)
15internal static int GetQualityFromCompressionLevel(CompressionLevel compressionLevel) => 18CompressionLevel.NoCompression => Quality_Min, 19CompressionLevel.Fastest => 1, 20CompressionLevel.Optimal => Quality_Default, 21CompressionLevel.SmallestSize => Quality_Max,
System\IO\Compression\enc\BrotliStream.Compress.cs (2)
20public BrotliStream(Stream stream, CompressionLevel compressionLevel) : this(stream, compressionLevel, leaveOpen: false) { } 27public BrotliStream(Stream stream, CompressionLevel compressionLevel, bool leaveOpen) : this(stream, CompressionMode.Compress, leaveOpen)
System.IO.Compression.ZipFile (29)
System\IO\Compression\ZipFile.Create.Async.cs (10)
268public static Task CreateFromDirectoryAsync(string sourceDirectoryName, string destinationArchiveFileName, CompressionLevel compressionLevel, bool includeBaseDirectory, CancellationToken cancellationToken = default) => 341CompressionLevel compressionLevel, bool includeBaseDirectory, Encoding? entryNameEncoding, CancellationToken cancellationToken = default) => 353/// If you want to include the base directory or specify a compression level, call the <see cref="CreateFromDirectory(string, Stream, CompressionLevel, bool)"/> method overload. 395/// <exception cref="ArgumentOutOfRangeException"><paramref name="compressionLevel"/> is not a valid <see cref="CompressionLevel"/> value.</exception> 398public static Task CreateFromDirectoryAsync(string sourceDirectoryName, Stream destination, CompressionLevel compressionLevel, bool includeBaseDirectory, CancellationToken cancellationToken = default) => 426/// <exception cref="ArgumentOutOfRangeException"><paramref name="compressionLevel"/> is not a valid <see cref="CompressionLevel"/> value.</exception> 430CompressionLevel compressionLevel, bool includeBaseDirectory, Encoding? entryNameEncoding, CancellationToken cancellationToken = default) => 488CompressionLevel? compressionLevel, bool includeBaseDirectory, Encoding? entryNameEncoding, CancellationToken cancellationToken) 507CompressionLevel? compressionLevel, bool includeBaseDirectory, Encoding? entryNameEncoding, CancellationToken cancellationToken) 521CompressionLevel? compressionLevel, bool includeBaseDirectory,
System\IO\Compression\ZipFile.Create.cs (11)
249public static void CreateFromDirectory(string sourceDirectoryName, string destinationArchiveFileName, CompressionLevel compressionLevel, bool includeBaseDirectory) => 319CompressionLevel compressionLevel, bool includeBaseDirectory, Encoding? entryNameEncoding) => 330/// If you want to include the base directory or specify a compression level, call the <see cref="CreateFromDirectory(string, Stream, CompressionLevel, bool)"/> method overload. 370/// <exception cref="ArgumentOutOfRangeException"><paramref name="compressionLevel"/> is not a valid <see cref="CompressionLevel"/> value.</exception> 371public static void CreateFromDirectory(string sourceDirectoryName, Stream destination, CompressionLevel compressionLevel, bool includeBaseDirectory) => 398/// <exception cref="ArgumentOutOfRangeException"><paramref name="compressionLevel"/> is not a valid <see cref="CompressionLevel"/> value.</exception> 400CompressionLevel compressionLevel, bool includeBaseDirectory, Encoding? entryNameEncoding) => 448CompressionLevel? compressionLevel, bool includeBaseDirectory, Encoding? entryNameEncoding) 462CompressionLevel? compressionLevel, bool includeBaseDirectory, Encoding? entryNameEncoding) 471CompressionLevel? compressionLevel, bool includeBaseDirectory, 536private static string ValidateAndGetFullPathForDoCreateFromDirectory(string sourceDirectoryName, Stream destination, CompressionLevel? compressionLevel)
System\IO\Compression\ZipFileCreationOptions.cs (1)
26public CompressionLevel CompressionLevel { get; set; }
System\IO\Compression\ZipFileExtensions.ZipArchive.Create.Async.cs (3)
109string sourceFileName, string entryName, CompressionLevel compressionLevel, CancellationToken cancellationToken = default) => 139string sourceFileName, string entryName, CompressionLevel compressionLevel, ReadOnlyMemory<char> password, ZipEncryptionMethod encryption, CancellationToken cancellationToken = default) => 143CompressionLevel? compressionLevel, ReadOnlyMemory<char> password = default, ZipEncryptionMethod encryption = ZipEncryptionMethod.None, CancellationToken cancellationToken = default)
System\IO\Compression\ZipFileExtensions.ZipArchive.Create.cs (4)
77string sourceFileName, string entryName, CompressionLevel compressionLevel) => 125string sourceFileName, string entryName, CompressionLevel compressionLevel, 130string sourceFileName, string entryName, CompressionLevel? compressionLevel, 147private static (FileStream, ZipArchiveEntry) InitializeDoCreateEntryFromFile(ZipArchive destination, string sourceFileName, string entryName, CompressionLevel? compressionLevel, bool useAsync, ReadOnlySpan<char> password = default, ZipEncryptionMethod encryption = ZipEncryptionMethod.None)
System.IO.Packaging (9)
System\IO\Packaging\ZipPackage.cs (9)
49CompressionLevel level; 442out CompressionLevel compressionLevel) 448compressionLevel = CompressionLevel.NoCompression; 453compressionLevel = CompressionLevel.Optimal; 459compressionLevel = CompressionLevel.SmallestSize; 467compressionLevel = CompressionLevel.Fastest; 472compressionLevel = CompressionLevel.Fastest; 812CompressionLevel compressionLevel) 1304private CompressionLevel _cachedCompressionLevel;
System.Reflection.Metadata (1)
System\Reflection\PortableExecutable\DebugDirectory\DebugDirectoryBuilder.EmbeddedPortablePdb.cs (1)
50using (var deflate = new DeflateStream(new BlobBuilderStream(builder), CompressionLevel.Optimal, leaveOpen: true))