From faaf303a9522fd367df26a754abcd25550622352 Mon Sep 17 00:00:00 2001 From: Xueming Shen Date: Thu, 7 Jul 2016 14:16:58 -0700 Subject: [PATCH] 8133170: Deflater.deflate with small output buffers fails Reviewed-by: bpb --- jdk/src/java.base/share/classes/java/util/zip/Deflater.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jdk/src/java.base/share/classes/java/util/zip/Deflater.java b/jdk/src/java.base/share/classes/java/util/zip/Deflater.java index 3e0089e079f..bf70f4dd8a1 100644 --- a/jdk/src/java.base/share/classes/java/util/zip/Deflater.java +++ b/jdk/src/java.base/share/classes/java/util/zip/Deflater.java @@ -417,7 +417,10 @@ class Deflater { *

In the case of {@link #FULL_FLUSH} or {@link #SYNC_FLUSH}, if * the return value is {@code len}, the space available in output * buffer {@code b}, this method should be invoked again with the same - * {@code flush} parameter and more output space. + * {@code flush} parameter and more output space. Make sure that + * {@code len} is greater than 6 to avoid flush marker (5 bytes) being + * repeatedly output to the output buffer every time this method is + * invoked. * * @param b the buffer for the compressed data * @param off the start offset of the data