 	public class Zlib implements ICompressor
 	{
 		/**
-		 * Uncompress the given ByteArray.
+		 * Uncompress (inflate) the given ByteArray.
 		 *
 		 * @param	data
 		 * @return Uncompressed data

			checkError(stream, err, "inflateEnd");
			
			
			// Checking ... is this needed?
			data.position = 0;
			for (i = 0; i < data.length; i++)
			{
				if (data.readByte() == 0)
				{
					break;
				}
			}
			
			uncompressed.position = 0;
			for (j = 0; j < uncompressed.length; j++)
			{
				if (uncompressed.readByte() == 0)
				{
					break;
				}
			}
			
			if (i == j)
			{
				uncompressed.position = 0;
				data.position = 0;
				for (i = 0; i < j; i++)
				{
					if (data.readByte() != uncompressed.readByte())
					{
						break;
					}
				}
				if (i == j)
				{
					trace("inflate(): " + String(uncompressed));
					//return;
				}
			}
			else
			{
				trace("bad inflate");
			}
			
			
			trace("Zlib.uncompress. uncompressed.length: " + uncompressed.length);
			trace("Zlib.uncompress. uncompressed: " + uncompressed.toString());
			
			return uncompressed;
		}
		
		/**
		 * Compress the given ByteArray. Will add Adler32 checksum to the end of the data.
		 *
		 * @param	data
		 * @return Compressed data

			stream.next_out = uncompressed;
			stream.next_out_index = 0;
			
			stream.avail_out = outBytesLength;
			stream.total_in = 0;
			
			
			err = stream.inflateInit();
			checkError(stream, err, "inflateInit");

			var outcount:int = 0;
			while (true)
			{
				// force small buffers
				stream.avail_in = 1;
				stream.avail_out = 1;
				
				err = stream.inflate(JZlib.Z_NO_FLUSH);
				switch (err)
				{
					case JZlib.Z_STREAM_END:
						// completed decompression, lets copy data and get out
						trace("Zlib.uncompress. inflation stream ended");
						break;
					case JZlib.Z_BUF_ERROR:
						stream.next_out_index = 0;
						stream.avail_out = outBytesLength;
						break;
					default:
						// unknown error
						if (err != JZlib.Z_OK)
						{
							if (stream.msg == null) {
								trace("Unknown error. Error code : " + err);
							}
							else {
								trace("Unknown error. Error code : " + err + " and message : " + stream.msg);
							}
						}
				}
				
				outcount++;
				//trace("Zlib.uncompress. outcount: " + outcount + ", stream.total_out: " + stream.total_out);

				if (!checkError(stream, err, "inflate"))
				{
