changeset 8186:efa09bf27d39

8020687: Deflater.setLevel does not work as expected Summary: to clarify the api to match the existing implementation behavior Reviewed-by: alanb
author sherman
date Sun, 15 Sep 2013 13:58:47 -0700
parents b9d59414de23
children db0fc2b71298
files src/share/classes/java/util/zip/Deflater.java
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/zip/Deflater.java	Sun Sep 15 11:16:58 2013 -0700
+++ b/src/share/classes/java/util/zip/Deflater.java	Sun Sep 15 13:58:47 2013 -0700
@@ -261,6 +261,12 @@
 
     /**
      * Sets the compression strategy to the specified value.
+     *
+     * <p> If the compression strategy is changed, the next invocation
+     * of {@code deflate} will compress the input available so far with
+     * the old strategy (and may be flushed); the new strategy will take
+     * effect only after that invocation.
+     *
      * @param strategy the new compression strategy
      * @exception IllegalArgumentException if the compression strategy is
      *                                     invalid
@@ -283,7 +289,13 @@
     }
 
     /**
-     * Sets the current compression level to the specified value.
+     * Sets the compression level to the specified value.
+     *
+     * <p> If the compression level is changed, the next invocation
+     * of {@code deflate} will compress the input available so far
+     * with the old level (and may be flushed); the new level will
+     * take effect only after that invocation.
+     *
      * @param level the new compression level (0-9)
      * @exception IllegalArgumentException if the compression level is invalid
      */