code: public void setPreset(int preset) throws UnsupportedOptionsException {
          if (preset < 0 || preset > 9)
              throw new UnsupportedOptionsException(
                      "Unsupported preset: " + preset);
  
          lc = LC_DEFAULT;
          lp = LP_DEFAULT;
          pb = PB_DEFAULT;
          dictSize = presetToDictSize[preset];
  
          if (preset <= 3) {
              mode = Mode.FAST;
              mf = MF_HC4;
              niceLen = preset <= 1 ? 128 : NICE_LEN_MAX;
              depthLimit = presetToDepthLimit[preset];
          } else {
              mode = Mode.NORMAL;
              mf = MF_BT4;
              niceLen = (preset == 4) ? 16 : (preset == 5) ? 32 : 64;
              depthLimit = 0;
          }
      }
docs: Sets the compression options to the given preset.
  <p>
  The presets 0-3 are fast presets with medium compression.
  The presets 4-6 are fairly slow presets with high compression.
  The default preset (<code>PRESET_DEFAULT</code>) is 6.
  <p>
  The presets 7-9 are like the preset 6 but use bigger dictionaries
  and have higher compressor and decompressor memory requirements.
  Unless the uncompressed size of the file exceeds 8&nbsp;MiB,
  16&nbsp;MiB, or 32&nbsp;MiB, it is waste of memory to use the
  presets 7, 8, or 9, respectively.
  
  @throws      UnsupportedOptionsException
  <code>preset</code> is not supported