Fixed via 8b495bb6e14becb5bda5e8b80257d5d186e18181

JDKZlibEncoder hangs (fails to flush) on large messages
If the message is great than 8k the message is not flushed.

codec/src/main/java/io/netty/handler/codec/compression/JdkZlibEncoder.java
codec/src/main/java/io/netty/handler/codec/compression/JdkZlibEncoder.java
diff --git a/codec/src/main/java/io/netty/handler/codec/compression/JdkZlibEncoder.java b/codec/src/main/java/io/netty/handler/codec/compression/JdkZlibEncoder.java
index d0fa3f0b0c7..be806f65210 100644
--- a/codec/src/main/java/io/netty/handler/codec/compression/JdkZlibEncoder.java
+++ b/codec/src/main/java/io/netty/handler/codec/compression/JdkZlibEncoder.java
@@ -212,8 +212,11 @@ protected void encode(ChannelHandlerContext ctx, ByteBuf uncompressed, ByteBuf o
 
         deflater.setInput(inAry);
         while (!deflater.needsInput()) {
-            int numBytes = deflater.deflate(encodeBuf, 0, encodeBuf.length, Deflater.SYNC_FLUSH);
-            out.writeBytes(encodeBuf, 0, numBytes);
+            int numBytes = encodeBuf.length;
+            while (numBytes == encodeBuf.length) {
+                numBytes = deflater.deflate(encodeBuf, 0, encodeBuf.length, Deflater.SYNC_FLUSH);
+                out.writeBytes(encodeBuf, 0, numBytes);
+            }
         }
     }
 
