163 references to ZLibNative
System.IO.Compression (163)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\LibraryImports.g.cs (21)
7
internal static unsafe extern partial global::System.IO.Compression.
ZLibNative
.ErrorCode DeflateInit2_(global::System.IO.Compression.
ZLibNative
.ZStream* stream, global::System.IO.Compression.
ZLibNative
.CompressionLevel level, global::System.IO.Compression.
ZLibNative
.CompressionMethod method, int windowBits, int memLevel, global::System.IO.Compression.
ZLibNative
.CompressionStrategy strategy);
15
internal static unsafe extern partial global::System.IO.Compression.
ZLibNative
.ErrorCode Deflate(global::System.IO.Compression.
ZLibNative
.ZStream* stream, global::System.IO.Compression.
ZLibNative
.FlushCode flush);
23
internal static unsafe extern partial global::System.IO.Compression.
ZLibNative
.ErrorCode DeflateEnd(global::System.IO.Compression.
ZLibNative
.ZStream* stream);
31
internal static unsafe extern partial global::System.IO.Compression.
ZLibNative
.ErrorCode DeflateReset(global::System.IO.Compression.
ZLibNative
.ZStream* stream);
39
internal static unsafe extern partial global::System.IO.Compression.
ZLibNative
.ErrorCode InflateInit2_(global::System.IO.Compression.
ZLibNative
.ZStream* stream, int windowBits);
47
internal static unsafe extern partial global::System.IO.Compression.
ZLibNative
.ErrorCode InflateReset2_(global::System.IO.Compression.
ZLibNative
.ZStream* stream, int windowBits);
55
internal static unsafe extern partial global::System.IO.Compression.
ZLibNative
.ErrorCode Inflate(global::System.IO.Compression.
ZLibNative
.ZStream* stream, global::System.IO.Compression.
ZLibNative
.FlushCode flush);
63
internal static unsafe extern partial global::System.IO.Compression.
ZLibNative
.ErrorCode InflateEnd(global::System.IO.Compression.
ZLibNative
.ZStream* stream);
src\runtime\src\libraries\Common\src\Interop\Interop.zlib.cs (21)
12
internal static unsafe partial
ZLibNative
.ErrorCode DeflateInit2_(
13
ZLibNative
.ZStream* stream,
14
ZLibNative
.CompressionLevel level,
15
ZLibNative
.CompressionMethod method,
18
ZLibNative
.CompressionStrategy strategy);
21
internal static unsafe partial
ZLibNative
.ErrorCode Deflate(
ZLibNative
.ZStream* stream,
ZLibNative
.FlushCode flush);
24
internal static unsafe partial
ZLibNative
.ErrorCode DeflateEnd(
ZLibNative
.ZStream* stream);
27
internal static unsafe partial
ZLibNative
.ErrorCode DeflateReset(
ZLibNative
.ZStream* stream);
30
internal static unsafe partial
ZLibNative
.ErrorCode InflateInit2_(
ZLibNative
.ZStream* stream, int windowBits);
33
internal static unsafe partial
ZLibNative
.ErrorCode InflateReset2_(
ZLibNative
.ZStream* stream, int windowBits);
36
internal static unsafe partial
ZLibNative
.ErrorCode Inflate(
ZLibNative
.ZStream* stream,
ZLibNative
.FlushCode flush);
39
internal static unsafe partial
ZLibNative
.ErrorCode InflateEnd(
ZLibNative
.ZStream* stream);
src\runtime\src\libraries\Common\src\System\IO\Compression\ZLibNative.ZStream.cs (2)
13
/// Always use <see cref="
ZLibNative
.ZLibStreamHandle.CreateForDeflate" /> or <see cref="
ZLibNative
.ZLibStreamHandle.CreateForInflate" /> instead.
System\IO\Compression\CompressionFormat.cs (1)
33
windowLog =
ZLibNative
.DefaultWindowLog;
System\IO\Compression\DeflateDecoder.cs (9)
15
private
ZLibNative
.ZLibStreamHandle? _state;
25
: this(
ZLibNative
.Deflate_DefaultWindowBits)
32
_state =
ZLibNative
.ZLibStreamHandle.CreateForInflate(windowBits);
87
ZLibNative
.ErrorCode errorCode = _state.Inflate(
ZLibNative
.FlushCode.NoFlush);
94
ZLibNative
.ErrorCode.Ok or
ZLibNative
.ErrorCode.BufError => _state.AvailOut == 0
97
ZLibNative
.ErrorCode.StreamEnd => OperationStatus.Done,
102
if (errorCode ==
ZLibNative
.ErrorCode.StreamEnd)
System\IO\Compression\DeflateEncoder.cs (36)
15
private
ZLibNative
.ZLibStreamHandle? _state;
24
: this(
ZLibNative
.DefaultQuality)
35
: this(quality,
ZLibNative
.DefaultWindowLog)
73
int memLevel = quality == (int)
ZLibNative
.CompressionLevel.NoCompression
74
?
ZLibNative
.Deflate_NoCompressionMemLevel
75
:
ZLibNative
.Deflate_DefaultMemLevel;
77
_state =
ZLibNative
.ZLibStreamHandle.CreateForDeflate(
78
(
ZLibNative
.CompressionLevel)quality,
81
ZLibNative
.CompressionStrategy.DefaultStrategy);
93
int memLevel = options.CompressionLevel == (int)
ZLibNative
.CompressionLevel.NoCompression
94
?
ZLibNative
.Deflate_NoCompressionMemLevel
95
:
ZLibNative
.Deflate_DefaultMemLevel;
97
_state =
ZLibNative
.ZLibStreamHandle.CreateForDeflate(
98
(
ZLibNative
.CompressionLevel)options.CompressionLevel,
101
(
ZLibNative
.CompressionStrategy)options.CompressionStrategy);
108
ArgumentOutOfRangeException.ThrowIfLessThan(quality,
ZLibNative
.MinQuality, nameof(quality));
109
ArgumentOutOfRangeException.ThrowIfGreaterThan(quality,
ZLibNative
.MaxQuality, nameof(quality));
117
ArgumentOutOfRangeException.ThrowIfLessThan(windowLog2,
ZLibNative
.MinWindowLog, nameof(windowLog2));
118
ArgumentOutOfRangeException.ThrowIfGreaterThan(windowLog2,
ZLibNative
.MaxWindowLog, nameof(windowLog2));
198
ZLibNative
.FlushCode flushCode = isFinalBlock ?
ZLibNative
.FlushCode.Finish :
ZLibNative
.FlushCode.NoFlush;
210
ZLibNative
.ErrorCode errorCode = _state.Deflate(flushCode);
217
ZLibNative
.ErrorCode.Ok when isFinalBlock => OperationStatus.DestinationTooSmall,
218
ZLibNative
.ErrorCode.Ok => _state.AvailIn == 0
221
ZLibNative
.ErrorCode.StreamEnd => OperationStatus.Done,
222
ZLibNative
.ErrorCode.BufError => _state.AvailOut == 0
229
if (isFinalBlock && errorCode ==
ZLibNative
.ErrorCode.StreamEnd)
266
ZLibNative
.ErrorCode errorCode = _state.Deflate(
ZLibNative
.FlushCode.SyncFlush);
272
ZLibNative
.ErrorCode.Ok => _state.AvailOut == 0
275
ZLibNative
.ErrorCode.StreamEnd => OperationStatus.Done,
276
ZLibNative
.ErrorCode.BufError => _state.AvailOut == 0
309
=> TryCompress(source, destination, out bytesWritten,
ZLibNative
.DefaultQuality,
ZLibNative
.DefaultWindowLog);
320
=> TryCompress(source, destination, out bytesWritten, quality,
ZLibNative
.DefaultWindowLog);
System\IO\Compression\DeflateZLib\Deflater.cs (9)
7
using ZErrorCode = System.IO.Compression.
ZLibNative
.ErrorCode;
8
using ZFlushCode = System.IO.Compression.
ZLibNative
.FlushCode;
17
private readonly
ZLibNative
.ZLibStreamHandle _zlibStream;
30
private Deflater(
ZLibNative
.ZLibStreamHandle zlibStream)
190
_zlibStream.NextIn =
ZLibNative
.ZNullPtr;
225
public static Deflater CreateDeflater(
ZLibNative
.CompressionLevel compressionLevel,
ZLibNative
.CompressionStrategy strategy, int windowBits, int memLevel)
229
ZLibNative
.ZLibStreamHandle zlibStream =
ZLibNative
.ZLibStreamHandle.CreateForDeflate(compressionLevel, windowBits, memLevel, strategy);
System\IO\Compression\DeflateZLib\DeflateStream.cs (15)
10
using static System.IO.Compression.
ZLibNative
;
27
internal DeflateStream(Stream stream, CompressionMode mode, long uncompressedSize) : this(stream, mode, leaveOpen: false,
ZLibNative
.Deflate_DefaultWindowBits, uncompressedSize)
35
public DeflateStream(Stream stream, CompressionMode mode, bool leaveOpen) : this(stream, mode, leaveOpen,
ZLibNative
.Deflate_DefaultWindowBits)
45
public DeflateStream(Stream stream, CompressionLevel compressionLevel, bool leaveOpen) : this(stream, compressionLevel, leaveOpen,
ZLibNative
.Deflate_DefaultWindowBits)
63
InitializeDeflater(stream, (
ZLibNative
.CompressionLevel)compressionOptions.CompressionLevel, (CompressionStrategy)compressionOptions.CompressionStrategy, leaveOpen, windowBits);
71
InitializeDeflater(stream, (
ZLibNative
.CompressionLevel)compressionOptions.CompressionLevel, (CompressionStrategy)compressionOptions.CompressionStrategy, leaveOpen, windowBits);
95
InitializeDeflater(stream,
ZLibNative
.CompressionLevel.DefaultCompression, CompressionStrategy.DefaultStrategy, leaveOpen, windowBits);
117
internal void InitializeDeflater(Stream stream,
ZLibNative
.CompressionLevel compressionLevel, CompressionStrategy strategy, bool leaveOpen, int windowBits)
131
private static
ZLibNative
.CompressionLevel GetZLibNativeCompressionLevel(CompressionLevel compressionLevel) =>
134
CompressionLevel.Optimal =>
ZLibNative
.CompressionLevel.DefaultCompression,
135
CompressionLevel.Fastest =>
ZLibNative
.CompressionLevel.BestSpeed,
136
CompressionLevel.NoCompression =>
ZLibNative
.CompressionLevel.NoCompression,
137
CompressionLevel.SmallestSize =>
ZLibNative
.CompressionLevel.BestCompression,
141
private static int GetMemLevel(
ZLibNative
.CompressionLevel level) =>
142
level ==
ZLibNative
.CompressionLevel.NoCompression ?
System\IO\Compression\DeflateZLib\Inflater.cs (21)
22
private readonly
ZLibNative
.ZLibStreamHandle _zlibStream; // The handle to the primary underlying zlib stream
31
private Inflater(int windowBits, long uncompressedSize,
ZLibNative
.ZLibStreamHandle zlibStream)
129
if (ReadInflateOutput(bufPtr, length,
ZLibNative
.FlushCode.NoFlush, out bytesRead) ==
ZLibNative
.ErrorCode.StreamEnd)
163
if (*nextInPointer !=
ZLibNative
.GZip_Header_ID1 || (nextAvailIn > 1 && *(nextInPointer + 1) !=
ZLibNative
.GZip_Header_ID2))
280
private unsafe
ZLibNative
.ErrorCode ReadInflateOutput(byte* bufPtr, int length,
ZLibNative
.FlushCode flushCode, out int bytesRead)
287
ZLibNative
.ErrorCode errC = Inflate(flushCode);
297
private
ZLibNative
.ErrorCode Inflate(
ZLibNative
.FlushCode flushCode)
299
ZLibNative
.ErrorCode errC;
310
case
ZLibNative
.ErrorCode.Ok: // progress has been made inflating
311
case
ZLibNative
.ErrorCode.StreamEnd: // The end of the input stream has been reached
314
case
ZLibNative
.ErrorCode.BufError: // No room in the output buffer - inflate() can be called again with more space to continue
317
case
ZLibNative
.ErrorCode.MemError: // Not enough memory to complete the operation
320
case
ZLibNative
.ErrorCode.DataError: // The input data was corrupted (input stream not conforming to the zlib format or incorrect check value)
323
case
ZLibNative
.ErrorCode.StreamError: //the stream structure was inconsistent (for example if next_in or next_out was NULL),
353
_zlibStream.NextIn =
ZLibNative
.ZNullPtr;
364
ZLibNative
.ZLibStreamHandle zlibStream =
ZLibNative
.ZLibStreamHandle.CreateForInflate(windowBits);
System\IO\Compression\DeflateZLib\ZLibException.cs (4)
18
private readonly
ZLibNative
.ErrorCode _zlibErrorCode =
ZLibNative
.ErrorCode.Ok;
31
_zlibErrorCode = (
ZLibNative
.ErrorCode)zlibErrorCode;
61
_zlibErrorCode = (
ZLibNative
.ErrorCode)info.GetInt32("zlibErrorCode");
System\IO\Compression\GZipDecoder.cs (1)
22
_deflateDecoder = new DeflateDecoder(
ZLibNative
.GZip_DefaultWindowBits);
System\IO\Compression\GZipEncoder.cs (6)
21
: this(
ZLibNative
.DefaultQuality,
ZLibNative
.DefaultWindowLog)
32
: this(quality,
ZLibNative
.DefaultWindowLog)
142
=> TryCompress(source, destination, out bytesWritten,
ZLibNative
.DefaultQuality,
ZLibNative
.DefaultWindowLog);
153
=> TryCompress(source, destination, out bytesWritten, quality,
ZLibNative
.DefaultWindowLog);
System\IO\Compression\GZipStream.cs (2)
21
_deflateStream = new DeflateStream(stream, mode, leaveOpen,
ZLibNative
.GZip_DefaultWindowBits);
32
_deflateStream = new DeflateStream(stream, compressionLevel, leaveOpen,
ZLibNative
.GZip_DefaultWindowBits);
System\IO\Compression\ZLibCompressionOptions.cs (7)
12
public static int DefaultWindowLog2 =>
ZLibNative
.DefaultWindowLog;
15
public static int MinWindowLog2 =>
ZLibNative
.MinWindowLog;
18
public static int MaxWindowLog2 =>
ZLibNative
.MaxWindowLog;
39
ArgumentOutOfRangeException.ThrowIfLessThan(value,
ZLibNative
.MinQuality, nameof(value));
40
ArgumentOutOfRangeException.ThrowIfGreaterThan(value,
ZLibNative
.MaxQuality, nameof(value));
79
ArgumentOutOfRangeException.ThrowIfLessThan(value,
ZLibNative
.MinWindowLog, nameof(value));
80
ArgumentOutOfRangeException.ThrowIfGreaterThan(value,
ZLibNative
.MaxWindowLog, nameof(value));
System\IO\Compression\ZLibDecoder.cs (1)
22
_deflateDecoder = new DeflateDecoder(
ZLibNative
.ZLib_DefaultWindowBits);
System\IO\Compression\ZLibEncoder.cs (5)
21
: this(
ZLibNative
.DefaultQuality)
32
: this(quality,
ZLibNative
.DefaultWindowLog)
135
=> TryCompress(source, destination, out bytesWritten,
ZLibNative
.DefaultQuality,
ZLibNative
.DefaultWindowLog);
146
=> TryCompress(source, destination, out bytesWritten, quality,
ZLibNative
.DefaultWindowLog);
System\IO\Compression\ZLibStream.cs (2)
29
_deflateStream = new DeflateStream(stream, mode, leaveOpen,
ZLibNative
.ZLib_DefaultWindowBits);
45
_deflateStream = new DeflateStream(stream, compressionLevel, leaveOpen,
ZLibNative
.ZLib_DefaultWindowBits);