xref: /aosp_15_r20/external/xz-java/README (revision 21943e31f48dee19de75c78c0efeb8417c9a67d0)
1
2XZ for Java
3===========
4
5Introduction
6
7    This aims to be a complete implementation of XZ data compression
8    in pure Java. Features:
9      - Full support for the .xz file format specification version 1.0.4
10      - Single-threaded streamed compression and decompression
11      - Single-threaded decompression with limited random access support
12      - Raw streams (no .xz headers) for advanced users, including LZMA2
13        with preset dictionary
14
15    Threading is planned but it is unknown when it will be implemented.
16
17    For the latest source code, see the project home page:
18
19        https://tukaani.org/xz/java.html
20
21    The source code is compatible with Java 5 and later (except
22    module-info.java which is Java 9 or later). However, the default
23    build options require OpenJDK 11 or later, and create Java 7
24    compatible binaries.
25
26Building with Apache Ant
27
28    Type "ant" to compile the classes and create the .jar files.
29    Type "ant doc" to build the javadoc HTML documentation. Note
30    that building the documentation will download a small file named
31    "element-list" or "package-list" from Oracle to enable linking to
32    the documentation of the standard Java classes.
33
34    If you are using Ant older than 1.9.8:
35
36        Edit build.xml and remove the release attributes from <javac>
37        tags, that is, remove all occurrences of these two lines:
38
39            release="${sourcever}"
40
41            release="${sourcever9}"
42
43        The downside of the above is that then -source and -target
44        options will be used instead of --release.
45
46    If you are using OpenJDK version older than 11:
47
48        Adjust extdoc_url and extdoc_file to point to an older URL
49        and to use "package-list" instead of "element-list". This
50        modification isn't required if the documentation won't be
51        built.
52
53    If you are using OpenJDK version older than 9:
54
55        Comment the sourcever9 line in the file build.properties.
56        When it is commented, module-info.java won't be built and
57        xz.jar won't be a modular JAR.
58
59    If you are using OpenJDK version older than 7:
60
61        In build.properties, set "sourcever = 5" or "sourcever = 6"
62        to be compatible with Java 5 or 6.
63
64Building without Apache Ant
65
66    If you cannot or don't want to use Ant, just compile all .java files
67    under the "src" directory (possibly skip the demo files src/*.java).
68    For module support (Java >= 9) compile also src9/module-info.java.
69
70Demo programs
71
72    You can test compression with XZEncDemo, which compresses from
73    standard input to standard output:
74
75        java -jar build/jar/XZEncDemo.jar < foo.txt > foo.txt.xz
76
77    You can test decompression with XZDecDemo, which decompresses to
78    standard output:
79
80        java -jar build/jar/XZDecDemo.jar foo.txt.xz
81
82Reporting bugs
83
84    Report bugs to <[email protected]> or visit the IRC channel
85    #tukaani on Freenode and talk to Larhzu.
86
87