code: public void setLevel(int level) {
          if ((level < 0 || level > 9) && level != DEFAULT_COMPRESSION) {
              throw new IllegalArgumentException("invalid compression level");
          }
          synchronized (zsRef) {
              if (this.level != level) {
                  this.level = level;
                  setParams = true;
              }
          }
      }
docs: 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