code: public void setStrategy(int strategy) {
          switch (strategy) {
            case DEFAULT_STRATEGY:
            case FILTERED:
            case HUFFMAN_ONLY:
              break;
            default:
              throw new IllegalArgumentException();
          }
          synchronized (zsRef) {
              if (this.strategy != strategy) {
                  this.strategy = strategy;
                  setParams = true;
              }
          }
      }
docs: 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