jpountz/lz4-java — pull request #43 by linnaea (2014-07-27 09:57:21+00:00)
Title: Allows changing lz4hc compression level

This pull request fixes issue #37.

The modified test case only checks for compression level 1, 5, 9 and 13, which I believe should be sufficient. Testing all levels up to 17 may take a long time. (Adding level 17 alone adds 1 minute to the overall test time on my machine, which has a Core i5-4200U CPU.)

To clarify, two macros in the lz4hc.c, LZ4HC_DEFAULT_COMPRESSIONLEVEL and MAX_COMPRESSION_LEVEL, are defined as 8 and 16 respectively, but when using these to determine the maximum search attempts, these two macros are used directly, while the level supplied by the user is first subtracted by one. So I wrote 8+1 and 16+1 in LZ4Constants.java.