79 references to ZLibNative
System.IO.Compression (79)
src\libraries\Common\src\Interop\Interop.zlib.cs (19)
12internal static unsafe partial ZLibNative.ErrorCode DeflateInit2_( 13ZLibNative.ZStream* stream, 14ZLibNative.CompressionLevel level, 15ZLibNative.CompressionMethod method, 18ZLibNative.CompressionStrategy strategy); 21internal static unsafe partial ZLibNative.ErrorCode Deflate(ZLibNative.ZStream* stream, ZLibNative.FlushCode flush); 24internal static unsafe partial ZLibNative.ErrorCode DeflateEnd(ZLibNative.ZStream* stream); 27internal static unsafe partial ZLibNative.ErrorCode InflateInit2_(ZLibNative.ZStream* stream, int windowBits); 30internal static unsafe partial ZLibNative.ErrorCode InflateReset2_(ZLibNative.ZStream* stream, int windowBits); 33internal static unsafe partial ZLibNative.ErrorCode Inflate(ZLibNative.ZStream* stream, ZLibNative.FlushCode flush); 36internal static unsafe partial ZLibNative.ErrorCode InflateEnd(ZLibNative.ZStream* stream);
src\libraries\Common\src\System\IO\Compression\ZLibNative.cs (3)
127* Do not remove the nested typing of types inside of <see cref="ZLibNative" />. 130* - Achieve the right encapsulation in a situation where <see cref="ZLibNative" /> may be compiled division-wide 132* scope is effectively like <c>public</c> scope when compiling <see cref="ZLibNative" /> into a higher
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\DeflateZLib\Deflater.cs (9)
7using ZErrorCode = System.IO.Compression.ZLibNative.ErrorCode; 8using ZFlushCode = System.IO.Compression.ZLibNative.FlushCode; 17private readonly ZLibNative.ZLibStreamHandle _zlibStream; 30private Deflater(ZLibNative.ZLibStreamHandle zlibStream) 163_zlibStream.NextIn = ZLibNative.ZNullPtr; 199public static Deflater CreateDeflater(ZLibNative.CompressionLevel compressionLevel, ZLibNative.CompressionStrategy strategy, int windowBits, int memLevel) 203ZLibNative.ZLibStreamHandle zlibStream = ZLibNative.ZLibStreamHandle.CreateForDeflate(compressionLevel, windowBits, memLevel, strategy);
System\IO\Compression\DeflateZLib\DeflateStream.cs (15)
10using static System.IO.Compression.ZLibNative; 27internal DeflateStream(Stream stream, CompressionMode mode, long uncompressedSize) : this(stream, mode, leaveOpen: false, ZLibNative.Deflate_DefaultWindowBits, uncompressedSize) 35public DeflateStream(Stream stream, CompressionMode mode, bool leaveOpen) : this(stream, mode, leaveOpen, ZLibNative.Deflate_DefaultWindowBits) 45public DeflateStream(Stream stream, CompressionLevel compressionLevel, bool leaveOpen) : this(stream, compressionLevel, leaveOpen, ZLibNative.Deflate_DefaultWindowBits) 56public DeflateStream(Stream stream, ZLibCompressionOptions compressionOptions, bool leaveOpen = false) : this(stream, compressionOptions, leaveOpen, ZLibNative.Deflate_DefaultWindowBits) 65InitializeDeflater(stream, (ZLibNative.CompressionLevel)compressionOptions.CompressionLevel, (CompressionStrategy)compressionOptions.CompressionStrategy, leaveOpen, windowBits); 89InitializeDeflater(stream, ZLibNative.CompressionLevel.DefaultCompression, CompressionStrategy.DefaultStrategy, leaveOpen, windowBits); 111internal void InitializeDeflater(Stream stream, ZLibNative.CompressionLevel compressionLevel, CompressionStrategy strategy, bool leaveOpen, int windowBits) 125private static ZLibNative.CompressionLevel GetZLibNativeCompressionLevel(CompressionLevel compressionLevel) => 128CompressionLevel.Optimal => ZLibNative.CompressionLevel.DefaultCompression, 129CompressionLevel.Fastest => ZLibNative.CompressionLevel.BestSpeed, 130CompressionLevel.NoCompression => ZLibNative.CompressionLevel.NoCompression, 131CompressionLevel.SmallestSize => ZLibNative.CompressionLevel.BestCompression, 135private static int GetMemLevel(ZLibNative.CompressionLevel level) => 136level == ZLibNative.CompressionLevel.NoCompression ?
System\IO\Compression\DeflateZLib\Inflater.cs (21)
22private readonly ZLibNative.ZLibStreamHandle _zlibStream; // The handle to the primary underlying zlib stream 29private Inflater(int windowBits, long uncompressedSize, ZLibNative.ZLibStreamHandle zlibStream) 119if (ReadInflateOutput(bufPtr, length, ZLibNative.FlushCode.NoFlush, out bytesRead) == ZLibNative.ErrorCode.StreamEnd) 150if (*nextInPointer != ZLibNative.GZip_Header_ID1 || (nextAvailIn > 1 && *(nextInPointer + 1) != ZLibNative.GZip_Header_ID2)) 233private unsafe ZLibNative.ErrorCode ReadInflateOutput(byte* bufPtr, int length, ZLibNative.FlushCode flushCode, out int bytesRead) 240ZLibNative.ErrorCode errC = Inflate(flushCode); 250private ZLibNative.ErrorCode Inflate(ZLibNative.FlushCode flushCode) 252ZLibNative.ErrorCode errC; 263case ZLibNative.ErrorCode.Ok: // progress has been made inflating 264case ZLibNative.ErrorCode.StreamEnd: // The end of the input stream has been reached 267case ZLibNative.ErrorCode.BufError: // No room in the output buffer - inflate() can be called again with more space to continue 270case ZLibNative.ErrorCode.MemError: // Not enough memory to complete the operation 273case ZLibNative.ErrorCode.DataError: // The input data was corrupted (input stream not conforming to the zlib format or incorrect check value) 276case ZLibNative.ErrorCode.StreamError: //the stream structure was inconsistent (for example if next_in or next_out was NULL), 296_zlibStream.NextIn = ZLibNative.ZNullPtr; 307ZLibNative.ZLibStreamHandle zlibStream = ZLibNative.ZLibStreamHandle.CreateForInflate(windowBits);
System\IO\Compression\DeflateZLib\ZLibException.cs (4)
18private 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);