Review comments
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 5 Jul 2011 17:28:44 +0000 (17:28 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 5 Jul 2011 17:28:44 +0000 (17:28 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1143150 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/tribes/group/interceptors/GzipInterceptor.java

index dca44a1..25926c6 100644 (file)
@@ -82,11 +82,12 @@ public class GzipInterceptor extends ChannelInterceptorBase {
      * @throws IOException
      */
     public static byte[] decompress(byte[] data) throws IOException {
-        ByteArrayOutputStream bout = new ByteArrayOutputStream();
+        ByteArrayOutputStream bout =
+            new ByteArrayOutputStream(DEFAULT_BUFFER_SIZE);
         ByteArrayInputStream bin = new ByteArrayInputStream(data);
         GZIPInputStream gin = new GZIPInputStream(bin);
         byte[] tmp = new byte[DEFAULT_BUFFER_SIZE];
-        int length = 0;
+        int length = gin.read(tmp);
         while (length > -1) {
             bout.write(tmp, 0, length);
             length = gin.read(tmp);