8133170: Deflater.deflate with small output buffers fails
authorsherman
Thu, 07 Jul 2016 14:16:58 -0700
changeset 39497 7701abdf2fb4
parent 39496 93c58a80c7f3
child 39498 7126d759e77a
8133170: Deflater.deflate with small output buffers fails Reviewed-by: bpb
jdk/src/java.base/share/classes/java/util/zip/Deflater.java
--- a/jdk/src/java.base/share/classes/java/util/zip/Deflater.java	Thu Jul 07 18:35:29 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/util/zip/Deflater.java	Thu Jul 07 14:16:58 2016 -0700
@@ -417,7 +417,10 @@
      * <p>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