73 references to ZLibNative
System.IO.Compression (73)
src\libraries\Common\src\Interop\Interop.zlib.cs (17)
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 Inflate(ZLibNative.ZStream* stream, ZLibNative.FlushCode flush); 33internal static unsafe partial ZLibNative.ErrorCode InflateEnd(ZLibNative.ZStream* stream);
System\IO\Compression\DeflateZLib\Deflater.cs (7)
8using ZErrorCode = System.IO.Compression.ZLibNative.ErrorCode; 9using ZFlushCode = System.IO.Compression.ZLibNative.FlushCode; 18private readonly ZLibNative.ZLibStreamHandle _zlibStream; 31internal Deflater(ZLibNative.CompressionLevel compressionLevel, ZLibNative.CompressionStrategy strategy, int windowBits, int memLevel) 38errC = ZLibNative.CreateZLibStreamForDeflate(out _zlibStream, compressionLevel, windowBits, memLevel, strategy); 187_zlibStream.NextIn = ZLibNative.ZNullPtr;
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 (24)
24private ZLibNative.ZLibStreamHandle _zlibStream; // The handle to the primary underlying zlib stream 125if (ReadInflateOutput(bufPtr, length, ZLibNative.FlushCode.NoFlush, out bytesRead) == ZLibNative.ErrorCode.StreamEnd) 157if (*nextInPointer != ZLibNative.GZip_Header_ID1 || (nextAvailIn > 1 && *(nextInPointer + 1) != ZLibNative.GZip_Header_ID2)) 242ZLibNative.ErrorCode error; 245error = ZLibNative.CreateZLibStreamForInflate(out _zlibStream, windowBits); 254case ZLibNative.ErrorCode.Ok: // Successful initialization 257case ZLibNative.ErrorCode.MemError: // Not enough memory 260case ZLibNative.ErrorCode.VersionError: //zlib library is incompatible with the version assumed 263case ZLibNative.ErrorCode.StreamError: // Parameters are invalid 274private unsafe ZLibNative.ErrorCode ReadInflateOutput(byte* bufPtr, int length, ZLibNative.FlushCode flushCode, out int bytesRead) 281ZLibNative.ErrorCode errC = Inflate(flushCode); 291private ZLibNative.ErrorCode Inflate(ZLibNative.FlushCode flushCode) 293ZLibNative.ErrorCode errC; 304case ZLibNative.ErrorCode.Ok: // progress has been made inflating 305case ZLibNative.ErrorCode.StreamEnd: // The end of the input stream has been reached 308case ZLibNative.ErrorCode.BufError: // No room in the output buffer - inflate() can be called again with more space to continue 311case ZLibNative.ErrorCode.MemError: // Not enough memory to complete the operation 314case ZLibNative.ErrorCode.DataError: // The input data was corrupted (input stream not conforming to the zlib format or incorrect check value) 317case 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)
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);