Allow setting preset for LZMACompressorOutputStream#664
Allow setting preset for LZMACompressorOutputStream#664dwalluck wants to merge 1 commit intoapache:masterfrom
Conversation
There was a problem hiding this comment.
Hi @dwalluck
Thank for your PR.
Let's not go start going down this road or we'll end up with asks for variations of:
public LZMA2Options(int dictSize, int lc, int lp, int pb, int mode,
int niceLen, int mf, int depthLimit)
Instead, please try to use this pattern in git master:
try (LZMACompressorOutputStream out = LZMACompressorOutputStream.builder()
.setPath(outPath)
.setLzma2Options(options)
.get()) {
out.writeUtf8(data);
}
I can see keeping the "normal" one-arg constructor around and using the builder for anything that requires a non-default configuration.
|
@garydgregory I understand. I only thought to add it for parity with XZ which already has this constructor. |
|
Wait, maybe I don't understand. You want to create a Builder just for the options? But, if we add a second arg of type |
|
There is already a |
|
Ah, it was just added that same day? That was fast! Thanks! However, if there were a builder for the options themselves, then the same pattern could be shared with xz, too. Otherwise, it seems xz needs its own builder, too, right? Similarly, I think zstd needs a way to get at all of the options that are available via the |
Right, I didn't notice, this was pushed directly to |
Hello @dwalluck Please see PR #666 to add a builder to TY, |
|
Closing: The feature is in git master through a builder. |
No description provided.