ulikunitz/xz

Achieving maximum xz compression

jftuga opened this issue · 2 comments

If I am using the following code, how do I set the options for maximum compression (the -9 preset level)?

// target is of type io.Writer
 xzw, _ := xz.NewWriter(target)

Unfortunately I'm not supporting Presets right now. What you can do is to use a larger dictionary. The default size is 8 MByte.

The line

xzw, err := xz.WriterConfig{DictCap: 16 * 1024 * 1024}.NewWriter(target)

should work.

Thanks.