View Single Post
Old 08-08-2008, 10:31 AM   #11 (permalink)
Lord_Helmchen
Lurker
 
Join Date: Oct 2002
Posts: 10
Default

I got it.
It's a compatibility issue between windows and unix.
Koders Code Search: ZLib.cs - C# - GPL
gave me the idea on what to do.

I edited Compression.cs in the following way:

Code:
//...

public sealed class CompressorUnix : ICompressor {
		[DllImport( "libz" )]
		private static extern string zlibVersion();

		[DllImport( "libz" )]
		private static extern ZLibError compress( byte[] dest, ref long destLength, byte[] source, int sourceLength );

		[DllImport( "libz" )]
		private static extern ZLibError compress2( byte[] dest, ref long destLength, byte[] source, int sourceLength, ZLibQuality quality );

		[DllImport( "libz" )]
		private static extern ZLibError uncompress( byte[] dest, ref long destLen, byte[] source, int sourceLen );

		public CompressorUnix() {
		}

		public string Version {
			get {
				return zlibVersion();
			}
		}

		public ZLibError Compress( byte[] dest, ref int destLength, byte[] source, int sourceLength ) {
            long d = destLength;
            ZLibError ret = compress( dest, ref d, source, sourceLength );
            destLength = (int)d;
            return ret;
		}

		public ZLibError Compress( byte[] dest, ref int destLength, byte[] source, int sourceLength, ZLibQuality quality ) {
            long d = destLength;
            ZLibError ret = compress2( dest, ref d, source, sourceLength, quality );
            destLength = (int)d;
            return ret;
		}

		public ZLibError Decompress( byte[] dest, ref int destLength, byte[] source, int sourceLength ) {
            long d = destLength;
            ZLibError ret = uncompress( dest, ref d, source, sourceLength );
            destLength = (int)d;
            return ret;
		}
	}

//...
I noticed, that without a user name and pass I am not able to commit to the svn.
But I think it would make a valuable addition.
Lord_Helmchen is offline   Reply With Quote