/
README
60 lines (46 loc) · 2.03 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
LZ4 Java
========
LZ4 compression for Java, based on Yann Collet's work available at
http://code.google.com/p/lz4/.
This library provides access to two compression methods that both generate a
valid LZ4 stream:
- fast scan (LZ4):
- low memory footprint (~ 16 KB),
- very fast (fast scan with skipping heuristics in case the input looks
incompressible),
- reasonable compression ratio (depending on the redundancy of the input).
- high compression (LZ4 HC):
- medium memory footprint (~ 256 KB),
- rather slow (~ 10 times slower than LZ4),
- good compression ratio (depending on the size and the redundancy of the
input).
The streams produced by those 2 compression algorithms use the same compression
format, are very fast to decompress and can be decompressed by the same
decompressor instance.
For LZ4 compressors, LZ4 HC compressors and decompressors, 3 implementations are
available:
- JNI bindings to the original C implementation by Yann Collet,
- a pure Java port of the compression and decompression algorithms,
- a Java port that uses the sun.misc.Unsafe API in order to achieve compression
and decompression speeds similar to the C implementation.
Please have a look at LZ4Factory for more information.
On 64-bits platforms, the Java compressor implementations compress data the same
way as the C implementation (meaning that the resulting arrays are identical).
However, similarly to the C implementation, compression might return different
compressed arrays on a machine of the opposite endianness.
xxhash Java
===========
xxhash hashing for Java, based on Yann Collet's work available at
http://code.google.com/p/xxhash/.
Similarly to LZ4, 3 implementations are available: JNI bindings, pure Java port
and pure Java port that uses sun.misc.Unsafe.
All implementations return the same result for the same input bytes.
Build
-----
Requirements
- JDK version 6 or newer,
- ant,
- ivy,
- ant-cpp-tasks.
Then run `ant`. It will compile C and Java code and generate a self-contained
JAR file under the dist directory.