73 references to ZLibNative
System.IO.Compression (73)
src\libraries\Common\src\Interop\Interop.zlib.cs (17)
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 InflateInit2_(
ZLibNative
.ZStream* stream, int windowBits);
30
internal static unsafe partial
ZLibNative
.ErrorCode Inflate(
ZLibNative
.ZStream* stream,
ZLibNative
.FlushCode flush);
33
internal static unsafe partial
ZLibNative
.ErrorCode InflateEnd(
ZLibNative
.ZStream* stream);
System\IO\Compression\DeflateZLib\Deflater.cs (7)
8
using ZErrorCode = System.IO.Compression.
ZLibNative
.ErrorCode;
9
using ZFlushCode = System.IO.Compression.
ZLibNative
.FlushCode;
18
private readonly
ZLibNative
.ZLibStreamHandle _zlibStream;
31
internal Deflater(
ZLibNative
.CompressionLevel compressionLevel,
ZLibNative
.CompressionStrategy strategy, int windowBits, int memLevel)
38
errC =
ZLibNative
.CreateZLibStreamForDeflate(out _zlibStream, compressionLevel, windowBits, memLevel, strategy);
187
_zlibStream.NextIn =
ZLibNative
.ZNullPtr;
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)
56
public DeflateStream(Stream stream, ZLibCompressionOptions compressionOptions, bool leaveOpen = false) : this(stream, compressionOptions, leaveOpen,
ZLibNative
.Deflate_DefaultWindowBits)
65
InitializeDeflater(stream, (
ZLibNative
.CompressionLevel)compressionOptions.CompressionLevel, (CompressionStrategy)compressionOptions.CompressionStrategy, leaveOpen, windowBits);
89
InitializeDeflater(stream,
ZLibNative
.CompressionLevel.DefaultCompression, CompressionStrategy.DefaultStrategy, leaveOpen, windowBits);
111
internal void InitializeDeflater(Stream stream,
ZLibNative
.CompressionLevel compressionLevel, CompressionStrategy strategy, bool leaveOpen, int windowBits)
125
private static
ZLibNative
.CompressionLevel GetZLibNativeCompressionLevel(CompressionLevel compressionLevel) =>
128
CompressionLevel.Optimal =>
ZLibNative
.CompressionLevel.DefaultCompression,
129
CompressionLevel.Fastest =>
ZLibNative
.CompressionLevel.BestSpeed,
130
CompressionLevel.NoCompression =>
ZLibNative
.CompressionLevel.NoCompression,
131
CompressionLevel.SmallestSize =>
ZLibNative
.CompressionLevel.BestCompression,
135
private static int GetMemLevel(
ZLibNative
.CompressionLevel level) =>
136
level ==
ZLibNative
.CompressionLevel.NoCompression ?
System\IO\Compression\DeflateZLib\Inflater.cs (24)
24
private
ZLibNative
.ZLibStreamHandle _zlibStream; // The handle to the primary underlying zlib stream
125
if (ReadInflateOutput(bufPtr, length,
ZLibNative
.FlushCode.NoFlush, out bytesRead) ==
ZLibNative
.ErrorCode.StreamEnd)
157
if (*nextInPointer !=
ZLibNative
.GZip_Header_ID1 || (nextAvailIn > 1 && *(nextInPointer + 1) !=
ZLibNative
.GZip_Header_ID2))
242
ZLibNative
.ErrorCode error;
245
error =
ZLibNative
.CreateZLibStreamForInflate(out _zlibStream, windowBits);
254
case
ZLibNative
.ErrorCode.Ok: // Successful initialization
257
case
ZLibNative
.ErrorCode.MemError: // Not enough memory
260
case
ZLibNative
.ErrorCode.VersionError: //zlib library is incompatible with the version assumed
263
case
ZLibNative
.ErrorCode.StreamError: // Parameters are invalid
274
private unsafe
ZLibNative
.ErrorCode ReadInflateOutput(byte* bufPtr, int length,
ZLibNative
.FlushCode flushCode, out int bytesRead)
281
ZLibNative
.ErrorCode errC = Inflate(flushCode);
291
private
ZLibNative
.ErrorCode Inflate(
ZLibNative
.FlushCode flushCode)
293
ZLibNative
.ErrorCode errC;
304
case
ZLibNative
.ErrorCode.Ok: // progress has been made inflating
305
case
ZLibNative
.ErrorCode.StreamEnd: // The end of the input stream has been reached
308
case
ZLibNative
.ErrorCode.BufError: // No room in the output buffer - inflate() can be called again with more space to continue
311
case
ZLibNative
.ErrorCode.MemError: // Not enough memory to complete the operation
314
case
ZLibNative
.ErrorCode.DataError: // The input data was corrupted (input stream not conforming to the zlib format or incorrect check value)
317
case
ZLibNative
.ErrorCode.StreamError: //the stream structure was inconsistent (for example if next_in or next_out was NULL),
335
_zlibStream.NextIn =
ZLibNative
.ZNullPtr;
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\GZipStream.cs (3)
21
_deflateStream = new DeflateStream(stream, mode, leaveOpen,
ZLibNative
.GZip_DefaultWindowBits);
32
_deflateStream = new DeflateStream(stream, compressionLevel, leaveOpen,
ZLibNative
.GZip_DefaultWindowBits);
44
_deflateStream = new DeflateStream(stream, compressionOptions, leaveOpen,
ZLibNative
.GZip_DefaultWindowBits);
System\IO\Compression\ZLibStream.cs (3)
29
_deflateStream = new DeflateStream(stream, mode, leaveOpen,
ZLibNative
.ZLib_DefaultWindowBits);
45
_deflateStream = new DeflateStream(stream, compressionLevel, leaveOpen,
ZLibNative
.ZLib_DefaultWindowBits);
57
_deflateStream = new DeflateStream(stream, compressionOptions, leaveOpen,
ZLibNative
.ZLib_DefaultWindowBits);