Author: nextgens
Date: 2008-08-13 17:31:32 +0000 (Wed, 13 Aug 2008)
New Revision: 21820

Modified:
   trunk/freenet/src/freenet/support/compress/GzipCompressor.java
Log:
pass maxLength to makeBucket() so that we can use RAMBuckets too

Modified: trunk/freenet/src/freenet/support/compress/GzipCompressor.java
===================================================================
--- trunk/freenet/src/freenet/support/compress/GzipCompressor.java      
2008-08-13 16:32:37 UTC (rev 21819)
+++ trunk/freenet/src/freenet/support/compress/GzipCompressor.java      
2008-08-13 17:31:32 UTC (rev 21820)
@@ -16,7 +16,7 @@
 public class GzipCompressor extends Compressor {

        public Bucket compress(Bucket data, BucketFactory bf, long maxLength) 
throws IOException, CompressionOutputSizeException {
-               Bucket output = bf.makeBucket(-1);
+               Bucket output = bf.makeBucket(maxLength);
                InputStream is = null;
                OutputStream os = null;
                GZIPOutputStream gos = null;
@@ -53,7 +53,7 @@
                if(preferred != null)
                        output = preferred;
                else
-                       output = bf.makeBucket(-1);
+                       output = bf.makeBucket(maxLength);
                InputStream is = data.getInputStream();
                OutputStream os = output.getOutputStream();
                decompress(is, os, maxLength, maxCheckSizeLength);


Reply via email to