コード例 #1
0
        internal DeflateStream(Stream compressedStream, CompressionMode mode, bool leaveOpen, bool gzip)
        {
            if (compressedStream == null)
            {
                throw new ArgumentNullException("compressedStream");
            }

            if (mode != CompressionMode.Compress && mode != CompressionMode.Decompress)
            {
                throw new ArgumentException("mode");
            }

            this.data        = GCHandle.Alloc(this);
            this.base_stream = compressedStream;
            this.feeder      = (mode == CompressionMode.Compress) ? new UnmanagedReadOrWrite(UnmanagedWrite) :
                               new UnmanagedReadOrWrite(UnmanagedRead);
            this.z_stream = CreateZStream(mode, gzip, feeder, GCHandle.ToIntPtr(data));
            if (z_stream == IntPtr.Zero)
            {
                this.base_stream = null;
                this.feeder      = null;
                throw new NotImplementedException("Failed to initialize zlib. You probably have an old zlib installed. Version 1.2.0.4 or later is required.");
            }
            this.mode      = mode;
            this.leaveOpen = leaveOpen;
        }
コード例 #2
0
ファイル: DeflateStream.cs プロジェクト: salloo/mono
		internal DeflateStream (Stream compressedStream, CompressionMode mode, bool leaveOpen, bool gzip)
		{
			if (compressedStream == null)
				throw new ArgumentNullException ("compressedStream");

			if (mode != CompressionMode.Compress && mode != CompressionMode.Decompress)
				throw new ArgumentException ("mode");

			this.data = GCHandle.Alloc (this);
			this.base_stream = compressedStream;
			this.feeder = (mode == CompressionMode.Compress) ? new UnmanagedReadOrWrite (UnmanagedWrite) :
									   new UnmanagedReadOrWrite (UnmanagedRead);
			this.z_stream = CreateZStream (mode, gzip, feeder, GCHandle.ToIntPtr (data));
			if (z_stream == IntPtr.Zero) {
				this.base_stream = null;
				this.feeder = null;
				throw new NotImplementedException ("Failed to initialize zlib. You probably have an old zlib installed. Version 1.2.0.4 or later is required.");
			}
			this.mode = mode;
			this.leaveOpen = leaveOpen;
		}
コード例 #3
0
		static IntPtr CreateZStream (CompressionMode compress, bool gzip, UnmanagedReadOrWrite feeder, IntPtr data)
		{
			throw new System.NotImplementedException();
		}
コード例 #4
0
ファイル: DeflateStream.cs プロジェクト: BrzVlad/mono
		static extern IntPtr CreateZStream (CompressionMode compress, bool gzip, UnmanagedReadOrWrite feeder, IntPtr data);
コード例 #5
0
ファイル: DeflateStream.cs プロジェクト: mdae/MonoRT
 static extern IntPtr CreateZStream(CompressionMode compress, bool gzip, UnmanagedReadOrWrite feeder, IntPtr data);
コード例 #6
0
 static IntPtr CreateZStream(CompressionMode compress, bool gzip, UnmanagedReadOrWrite feeder, IntPtr data)
 {
     throw new System.NotImplementedException();
 }