Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,25 @@ public LZMACompressorOutputStream(final OutputStream outputStream) throws IOExce
super(new LZMAOutputStream(outputStream, new LZMA2Options(), -1));
}

/**
* Creates a LZMA compressor using the specified LZMA2 preset level.
* <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 is 6.
* </p>
* <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.
* </p>
*
* @param outputStream the stream to wrap
* @param preset the preset
* @throws IOException on error
*/
@SuppressWarnings("resource") // Caller closes
public LZMACompressorOutputStream(final OutputStream outputStream, final int preset) throws IOException {
super(new LZMAOutputStream(outputStream, new LZMA2Options(preset), -1));
}

/**
* Finishes compression without closing the underlying stream. No more data can be written to this stream after finishing.
*
Expand Down