aboutsummaryrefslogtreecommitdiff
path: root/src/org/tukaani/xz/SeekableXZInputStream.java
diff options
context:
space:
mode:
authorSadaf Ebrahimi <sadafebrahimi@google.com>2023-11-28 21:56:59 +0000
committerSadaf Ebrahimi <sadafebrahimi@google.com>2023-11-28 21:56:59 +0000
commitb219c5e34dbb51cacc70fc013fb6ff7d45144dd5 (patch)
treef7ce3ef7bbd379ee4c157f39fbf64c85f70418cd /src/org/tukaani/xz/SeekableXZInputStream.java
parent7bca25ca77b0138f738d0a296defb2a45525eeae (diff)
parenta6e4dc6aca696af220ca64f9336786d5fbff3c0b (diff)
downloadxz-java-b219c5e34dbb51cacc70fc013fb6ff7d45144dd5.tar.gz
Upgrade XZ for Java to v1.9
This project was upgraded with external_updater. Usage: tools/external_updater/updater.sh update xz-java For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md Test: TreeHugger Change-Id: I45526f12c3b5d8ab641ffd5d3519b604a8ab0647
Diffstat (limited to 'src/org/tukaani/xz/SeekableXZInputStream.java')
-rw-r--r--src/org/tukaani/xz/SeekableXZInputStream.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/org/tukaani/xz/SeekableXZInputStream.java b/src/org/tukaani/xz/SeekableXZInputStream.java
index 74f130e..74da2e1 100644
--- a/src/org/tukaani/xz/SeekableXZInputStream.java
+++ b/src/org/tukaani/xz/SeekableXZInputStream.java
@@ -45,7 +45,7 @@ import org.tukaani.xz.index.BlockInfo;
* Block inside a Stream is located using binary search and thus is fast
* even with a huge number of Blocks.
*
- * <h4>Memory usage</h4>
+ * <h2>Memory usage</h2>
* <p>
* The amount of memory needed for the Indexes is taken into account when
* checking the memory usage limit. Each Stream is calculated to need at
@@ -53,7 +53,7 @@ import org.tukaani.xz.index.BlockInfo;
* to the next kibibyte. So unless the file has a huge number of Streams or
* Blocks, these don't take significant amount of memory.
*
- * <h4>Creating random-accessible .xz files</h4>
+ * <h2>Creating random-accessible .xz files</h2>
* <p>
* When using {@link XZOutputStream}, a new Block can be started by calling
* its {@link XZOutputStream#endBlock() endBlock} method. If you know
@@ -69,6 +69,21 @@ import org.tukaani.xz.index.BlockInfo;
* <code>--block-list=SIZES</code> which allows specifying sizes of
* individual Blocks.
*
+ * <h2>Example: getting the uncompressed size of a .xz file</h2>
+ * <blockquote><pre>
+ * String filename = "foo.xz";
+ * SeekableFileInputStream seekableFile
+ * = new SeekableFileInputStream(filename);
+ *
+ * try {
+ * SeekableXZInputStream seekableXZ
+ * = new SeekableXZInputStream(seekableFile);
+ * System.out.println("Uncompressed size: " + seekableXZ.length());
+ * } finally {
+ * seekableFile.close();
+ * }
+ * </pre></blockquote>
+ *
* @see SeekableFileInputStream
* @see XZInputStream
* @see XZOutputStream