silence Java8's javadoc, add a few @since tags
diff --git a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
index 7f773aa..1938f67 100644
--- a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
+++ b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
@@ -137,7 +137,7 @@
* char xmagic[4]; // offset 508 "tar"
* };
* </pre>
- * which is identical to new-style POSIX up to the first 130 bytes of the prefix.</p>
+ * <p>which is identical to new-style POSIX up to the first 130 bytes of the prefix.</p>
*
* @NotThreadSafe
*/
@@ -926,6 +926,7 @@
/**
* Check whether this is a sparse entry.
*
+ * @return whether this is a sparse entry
* @since 1.11
*/
public boolean isSparse() {
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/PKWareExtraHeader.java b/src/main/java/org/apache/commons/compress/archivers/zip/PKWareExtraHeader.java
index 9064c9d..bc44d52 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/PKWareExtraHeader.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/PKWareExtraHeader.java
@@ -34,13 +34,13 @@
*
* <ul>
* <li>0x6601 - DES</li>
- * <li>0x6602 - RC2 (version needed to extract < 5.2)</li>
+ * <li>0x6602 - RC2 (version needed to extract < 5.2)</li>
* <li>0x6603 - 3DES 168</li>
* <li>0x6609 - 3DES 112</li>
* <li>0x660E - AES 128</li>
* <li>0x660F - AES 192</li>
* <li>0x6610 - AES 256</li>
- * <li>0x6702 - RC2 (version needed to extract >= 5.2)</li>
+ * <li>0x6702 - RC2 (version needed to extract >= 5.2)</li>
* <li>0x6720 - Blowfish</li>
* <li>0x6721 - Twofish</li>
* <li>0x6801 - RC4</li>
@@ -60,11 +60,15 @@
* <li>0x800D - SHA384</li>
* <li>0x800E - SHA512</li>
* </ul>
+ *
+ * @since 1.11
*/
public abstract class PKWareExtraHeader implements ZipExtraField {
/**
* Encryption algorithm.
+ *
+ * @since 1.11
*/
public enum EncryptionAlgorithm {
DES(0x6601),
@@ -107,8 +111,11 @@
}
/**
- * returns the EncryptionAlgorithm for the given code or null if the
+ * Returns the EncryptionAlgorithm for the given code or null if the
* method is not known.
+ * @param code the code of the algorithm
+ * @return the EncryptionAlgorithm for the given code or null
+ * if the method is not known
*/
public static EncryptionAlgorithm getAlgorithmByCode(int code) {
return codeToEnum.get(Integer.valueOf(code));
@@ -117,6 +124,8 @@
/**
* Hash Algorithm
+ *
+ * @since 1.11
*/
public enum HashAlgorithm {
NONE(0),
@@ -157,8 +166,11 @@
}
/**
- * returns the HashAlgorithm for the given code or null if the method is
+ * Returns the HashAlgorithm for the given code or null if the method is
* not known.
+ * @param code the code of the algorithm
+ * @return the HashAlgorithm for the given code or null
+ * if the method is not known
*/
public static HashAlgorithm getAlgorithmByCode(int code) {
return codeToEnum.get(Integer.valueOf(code));
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/X000A_NTFS.java b/src/main/java/org/apache/commons/compress/archivers/zip/X000A_NTFS.java
index 7e44eca..0b5e419 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/X000A_NTFS.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/X000A_NTFS.java
@@ -59,6 +59,9 @@
* Atime 8 bytes File last access time
* Ctime 8 bytes File creation time
* </pre>
+ *
+ * @since 1.11
+ * @NotThreadSafe
*/
public class X000A_NTFS implements ZipExtraField {
private static final ZipShort HEADER_ID = new ZipShort(0x000a);
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/X0014_X509Certificates.java b/src/main/java/org/apache/commons/compress/archivers/zip/X0014_X509Certificates.java
index 0b067d8..c58ea74 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/X0014_X509Certificates.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/X0014_X509Certificates.java
@@ -19,15 +19,15 @@
package org.apache.commons.compress.archivers.zip;
/**
- * PKCS#7 Store for X.509 Certificates (0x0014):
+ * PKCS#7 Store for X.509 Certificates (0x0014).
*
- * This field MUST contain information about each of the certificates files may
+ * <p>This field MUST contain information about each of the certificates files may
* be signed with. When the Central Directory Encryption feature is enabled for
* a ZIP file, this record will appear in the Archive Extra Data Record,
* otherwise it will appear in the first central directory record and will be
- * ignored in any other record.
+ * ignored in any other record.</p>
*
- * Note: all fields stored in Intel low-byte/high-byte order.
+ * <p>Note: all fields stored in Intel low-byte/high-byte order.</p>
*
* <pre>
* Value Size Description
@@ -38,6 +38,7 @@
* </pre>
*
* @NotThreadSafe
+ * @since 1.11
*/
public class X0014_X509Certificates extends PKWareExtraHeader implements ZipExtraField {
private static final ZipShort HEADER_ID = new ZipShort(0x0014);
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/X0015_CertificateIdForFile.java b/src/main/java/org/apache/commons/compress/archivers/zip/X0015_CertificateIdForFile.java
index 26fb806..1b2026a 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/X0015_CertificateIdForFile.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/X0015_CertificateIdForFile.java
@@ -19,14 +19,14 @@
package org.apache.commons.compress.archivers.zip;
/**
- * X.509 Certificate ID and Signature for individual file (0x0015):
+ * X.509 Certificate ID and Signature for individual file (0x0015).
*
- * This field contains the information about which certificate in the PKCS#7
+ * <p>This field contains the information about which certificate in the PKCS#7
* store was used to sign a particular file. It also contains the signature
* data. This field can appear multiple times, but can only appear once per
- * certificate.
+ * certificate.</p>
*
- * Note: all fields stored in Intel low-byte/high-byte order.
+ * <p>Note: all fields stored in Intel low-byte/high-byte order.</p>
*
* <pre>
* Value Size Description
@@ -39,6 +39,7 @@
* </pre>
*
* @NotThreadSafe
+ * @since 1.11
*/
public class X0015_CertificateIdForFile extends PKWareExtraHeader implements ZipExtraField {
private static final ZipShort HEADER_ID = new ZipShort(0x0015);
@@ -64,7 +65,7 @@
/**
* Get record count.
- * @return
+ * @return the record count
*/
public int getRecordCount() {
return rcount;
@@ -72,7 +73,7 @@
/**
* Get hash algorithm.
- * @return
+ * @return the hash algorithm
*/
public HashAlgorithm getHashAlgorithm() {
return hashAlg;
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/X0016_CertificateIdForCentralDirectory.java b/src/main/java/org/apache/commons/compress/archivers/zip/X0016_CertificateIdForCentralDirectory.java
index 2ce7ef0..55182e6 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/X0016_CertificateIdForCentralDirectory.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/X0016_CertificateIdForCentralDirectory.java
@@ -19,15 +19,15 @@
package org.apache.commons.compress.archivers.zip;
/**
- * X.509 Certificate ID and Signature for central directory (0x0016):
+ * X.509 Certificate ID and Signature for central directory (0x0016).
*
- * This field contains the information about which certificate in the PKCS#7
+ * <p>This field contains the information about which certificate in the PKCS#7
* store was used to sign the central directory structure. When the Central
* Directory Encryption feature is enabled for a ZIP file, this record will
* appear in the Archive Extra Data Record, otherwise it will appear in the
- * first central directory record.
+ * first central directory record.</p>
*
- * Note: all fields stored in Intel low-byte/high-byte order.
+ * <p>Note: all fields stored in Intel low-byte/high-byte order.</p>
*
* <pre>
* Value Size Description
@@ -40,6 +40,7 @@
* </pre>
*
* @NotThreadSafe
+ * @since 1.11
*/
public class X0016_CertificateIdForCentralDirectory extends PKWareExtraHeader implements ZipExtraField {
private static final ZipShort HEADER_ID = new ZipShort(0x0016);
@@ -65,7 +66,7 @@
/**
* Get record count.
- * @return
+ * @return the record count
*/
public int getRecordCount() {
return rcount;
@@ -73,7 +74,7 @@
/**
* Get hash algorithm.
- * @return
+ * @return the hash algorithm
*/
public HashAlgorithm getHashAlgorithm() {
return hashAlg;
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/X0017_StrongEncryptionHeader.java b/src/main/java/org/apache/commons/compress/archivers/zip/X0017_StrongEncryptionHeader.java
index e271975..11c25ea 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/X0017_StrongEncryptionHeader.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/X0017_StrongEncryptionHeader.java
@@ -19,9 +19,9 @@
package org.apache.commons.compress.archivers.zip;
/**
- * Strong Encryption Header (0x0017)
+ * Strong Encryption Header (0x0017).
*
- * Certificate-based encryption:
+ * <p>Certificate-based encryption:</p>
*
* <pre>
* Value Size Description
@@ -38,6 +38,7 @@
* SRList (var) Simple list of recipients hashed public keys
*
* Flags - This defines the processing flags.
+ * </pre>
*
* <ul>
* <li>0x0007 - reserved for future use
@@ -52,6 +53,7 @@
* <li>0x8000 - reserved for future use
* </ul>
*
+ * <pre>
* RCount - This defines the number intended recipients whose
* public keys were used for encryption. This identifies
* the number of elements in the SRList.
@@ -73,7 +75,7 @@
* SRList is determined using RCount * HSize.
* </pre>
*
- * Password-based Extra Field 0x0017 in central header only.
+ * <p>Password-based Extra Field 0x0017 in central header only.</p>
*
* <pre>
* Value Size Description
@@ -87,10 +89,10 @@
* (more?)
* </pre>
*
- * <b>Format</b> - the data format identifier for this record. The only value
- * allowed at this time is the integer value 2.
+ * <p><b>Format</b> - the data format identifier for this record. The only value
+ * allowed at this time is the integer value 2.</p>
*
- * Password-based Extra Field 0x0017 preceding compressed file data.
+ * <p>Password-based Extra Field 0x0017 preceding compressed file data.</p>
*
* <pre>
* Value Size Description
@@ -152,8 +154,7 @@
* stream of encrypted data for a file.
* </pre>
*
- *
- * Reserved1 - Certificate Decryption Header Reserved1 Data:
+ * <p>Reserved1 - Certificate Decryption Header Reserved1 Data:</p>
*
* <pre>
* Value Size Description
@@ -161,12 +162,11 @@
* RCount 4 bytes Number of recipients.
* </pre>
*
- * RCount - This defines the number intended recipients whose public keys were
+ * <p>RCount - This defines the number intended recipients whose public keys were
* used for encryption. This defines the number of elements in the REList field
- * defined below.
+ * defined below.</p>
*
- *
- * Reserved2 - Certificate Decryption Header Reserved2 Data Structures:
+ * <p>Reserved2 - Certificate Decryption Header Reserved2 Data Structures:</p>
*
* <pre>
* Value Size Description
@@ -190,7 +190,7 @@
* Element data structure as follows:
* </pre>
*
- * Recipient Element (REList) Data Structure:
+ * <p>Recipient Element (REList) Data Structure:</p>
*
* <pre>
* Value Size Description
@@ -218,7 +218,7 @@
* For more details see https://msdn.microsoft.com/en-us/library/aa920051.aspx
* </pre>
*
- * <b>Flags</b> - Processing flags needed for decryption
+ * <p><b>Flags</b> - Processing flags needed for decryption</p>
*
* <ul>
* <li>0x0001 - Password is required to decrypt</li>
@@ -234,12 +234,13 @@
* <li>0x8000 - reserved for future use.
* </ul>
*
- * <b>See the section describing the Strong Encryption Specification for
+ * <p><b>See the section describing the Strong Encryption Specification for
* details. Refer to the section in this document entitled
* "Incorporating PKWARE Proprietary Technology into Your Product" for more
- * information.</b>
+ * information.</b></p>
*
* @NotThreadSafe
+ * @since 1.11
*/
public class X0017_StrongEncryptionHeader extends PKWareExtraHeader implements ZipExtraField {
private static final ZipShort HEADER_ID = new ZipShort(0x0017);
@@ -282,7 +283,7 @@
/**
* Get record count.
- * @return
+ * @return the record count
*/
public long getRecordCount() {
return rcount;
@@ -290,7 +291,7 @@
/**
* Get hash algorithm.
- * @return
+ * @return the hash algorithm
*/
public HashAlgorithm getHashAlgorithm() {
return hashAlg;
@@ -298,7 +299,7 @@
/**
* Get encryption algorithm.
- * @return
+ * @return the encryption algorithm
*/
public EncryptionAlgorithm getEncryptionAlgorithm() {
return algId;
@@ -377,9 +378,9 @@
/**
* Parse central directory format.
*
- * @param data
- * @param offset
- * @param length
+ * @param data the buffer to read data from
+ * @param offset offset into buffer to read data
+ * @param length the length of data
*/
public void parseCentralDirectoryFormat(byte[] data, int offset, int length) {
this.format = ZipShort.getValue(data, offset);
@@ -401,11 +402,13 @@
}
/**
- * Parse file header format. (Password only?)
+ * Parse file header format.
*
- * @param data
- * @param offset
- * @param length
+ * <p>(Password only?)</p>
+ *
+ * @param data the buffer to read data from
+ * @param offset offset into buffer to read data
+ * @param length the length of data
*/
public void parseFileFormat(byte[] data, int offset, int length) {
int ivSize = ZipShort.getValue(data, offset);
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/X0019_EncryptionRecipientCertificateList.java b/src/main/java/org/apache/commons/compress/archivers/zip/X0019_EncryptionRecipientCertificateList.java
index 04b0904..78e33df 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/X0019_EncryptionRecipientCertificateList.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/X0019_EncryptionRecipientCertificateList.java
@@ -19,17 +19,17 @@
package org.apache.commons.compress.archivers.zip;
/**
- * PKCS#7 Encryption Recipient Certificate List (0x0019)
+ * PKCS#7 Encryption Recipient Certificate List (0x0019).
*
- * This field MAY contain information about each of the certificates used in
+ * <p>This field MAY contain information about each of the certificates used in
* encryption processing and it can be used to identify who is allowed to
* decrypt encrypted files. This field should only appear in the archive extra
* data record. This field is not required and serves only to aid archive
* modifications by preserving public encryption key data. Individual security
* requirements may dictate that this data be omitted to deter information
- * exposure.
+ * exposure.</p>
*
- * Note: all fields stored in Intel low-byte/high-byte order.
+ * <p>Note: all fields stored in Intel low-byte/high-byte order.</p>
*
* <pre>
* Value Size Description
@@ -40,12 +40,13 @@
* CStore (var) PKCS#7 data blob
* </pre>
*
- * <b>See the section describing the Strong Encryption Specification for
+ * <p><b>See the section describing the Strong Encryption Specification for
* details. Refer to the section in this document entitled
* "Incorporating PKWARE Proprietary Technology into Your Product" for more
- * information.</b>
+ * information.</b></p>
*
* @NotThreadSafe
+ * @since 1.11
*/
public class X0019_EncryptionRecipientCertificateList extends PKWareExtraHeader implements ZipExtraField {
private static final ZipShort HEADER_ID = new ZipShort(0x0019);
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
index ddb2ebc..f89a862 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
@@ -747,10 +747,10 @@
}
/**
- * Wraps {@link ZipEntry#getTime} with a {@link Date} as the
+ * Wraps {@link java.util.zip.ZipEntry#getTime} with a {@link Date} as the
* entry's last modified date.
*
- * <p>Changes to the implementation of {@link ZipEntry#getTime}
+ * <p>Changes to the implementation of {@link java.util.zip.ZipEntry#getTime}
* leak through and the returned value may depend on your local
* time zone as well as your version of Java.</p>
*/
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
index 31444d7..f6331e8 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
@@ -349,13 +349,14 @@
}
/**
- * Expose the raw stream of the archive entry (compressed form)
- * <p/>
- * This method does not relate to how/if we understand the payload in the
- * stream, since we really only intend to move it on to somewhere else.
+ * Expose the raw stream of the archive entry (compressed form).
+ *
+ * <p>This method does not relate to how/if we understand the payload in the
+ * stream, since we really only intend to move it on to somewhere else.</p>
*
* @param ze The entry to get the stream for
* @return The raw input stream containing (possibly) compressed data.
+ * @since 1.11
*/
public InputStream getRawInputStream(ZipArchiveEntry ze) {
if (!(ze instanceof Entry)) {
@@ -370,7 +371,7 @@
/**
* Transfer selected entries from this zipfile to a given #ZipArchiveOutputStream.
* Compression and all other attributes will be as in this file.
- * This method transfers entries based on the central directory of the zip file.
+ * <p>This method transfers entries based on the central directory of the zip file.</p>
*
* @param target The zipArchiveOutputStream to write the entries to
* @param predicate A predicate that selects which entries to write
diff --git a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
index 14e924e..486ae8d 100644
--- a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
@@ -605,6 +605,7 @@
/**
* Returns the blocksize parameter specified at construction time.
+ * @return the blocksize parameter specified at construction time
*/
public final int getBlockSize() {
return this.blockSize100k;
diff --git a/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorOutputStream.java b/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorOutputStream.java
index e978a57..3e354d6 100644
--- a/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorOutputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorOutputStream.java
@@ -77,7 +77,8 @@
/**
* Finishes compression without closing the underlying stream.
- * No more data can be written to this stream after finishing.
+ * <p>No more data can be written to this stream after finishing.</p>
+ * @throws IOException on error
*/
public void finish() throws IOException {
out.finish();
diff --git a/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateParameters.java b/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateParameters.java
index 543b4ac..1d32f7e 100644
--- a/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateParameters.java
+++ b/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateParameters.java
@@ -33,6 +33,7 @@
/**
* Whether or not the zlib header shall be written (when
* compressing) or expected (when decompressing).
+ * @return true if zlib header shall be written
*/
public boolean withZlibHeader() {
return zlibHeader;
@@ -44,7 +45,7 @@
* <p>This affects whether or not the zlib header will be written
* (when compressing) or expected (when decompressing).</p>
*
- * @param zlibHeader
+ * @param zlibHeader true if zlib header shall be written
*/
public void setWithZlibHeader(boolean zlibHeader) {
this.zlibHeader = zlibHeader;
@@ -53,6 +54,7 @@
/**
* The compression level.
* @see #setCompressionLevel
+ * @return the compression level
*/
public int getCompressionLevel() {
return compressionLevel;
diff --git a/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java b/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java
index a148323..aeae8c0 100644
--- a/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java
@@ -63,6 +63,8 @@
/**
* Creates a gzip compressed output stream with the default parameters.
+ * @param out the stream to compress to
+ * @throws IOException if writing fails
*/
public GzipCompressorOutputStream(OutputStream out) throws IOException {
this(out, new GzipParameters());
@@ -70,6 +72,9 @@
/**
* Creates a gzip compressed output stream with the specified parameters.
+ * @param out the stream to compress to
+ * @param parameters the parameters to use
+ * @throws IOException if writing fails
*
* @since 1.7
*/
@@ -172,6 +177,7 @@
* Finishes writing compressed data to the underlying stream without closing it.
*
* @since 1.7
+ * @throws IOException on error
*/
public void finish() throws IOException {
if (!deflater.finished()) {
diff --git a/src/main/java/org/apache/commons/compress/compressors/lzma/LZMAUtils.java b/src/main/java/org/apache/commons/compress/compressors/lzma/LZMAUtils.java
index 7d3e1be..9d5af20 100644
--- a/src/main/java/org/apache/commons/compress/compressors/lzma/LZMAUtils.java
+++ b/src/main/java/org/apache/commons/compress/compressors/lzma/LZMAUtils.java
@@ -84,6 +84,8 @@
/**
* Are the classes required to support LZMA compression available?
+ * @return true if the classes required to support LZMA
+ * compression are available
*/
public static boolean isLZMACompressionAvailable() {
final CachedAvailability cachedResult = cachedLZMAAvailability;
diff --git a/src/main/java/org/apache/commons/compress/compressors/lzw/LZWInputStream.java b/src/main/java/org/apache/commons/compress/compressors/lzw/LZWInputStream.java
index 4a99a97..89988c9 100644
--- a/src/main/java/org/apache/commons/compress/compressors/lzw/LZWInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/lzw/LZWInputStream.java
@@ -88,17 +88,24 @@
/**
* Read the next code and expand it.
+ * @return the expanded next code
+ * @throws IOException on error
*/
protected abstract int decompressNextSymbol() throws IOException;
/**
* Add a new entry to the dictionary.
+ * @param previousCode the previous code
+ * @param character the next character to append
+ * @return the new code
+ * @throws IOException on error
*/
protected abstract int addEntry(int previousCode, byte character)
throws IOException;
/**
* Sets the clear code based on the code size.
+ * @param codeSize code size
*/
protected void setClearCode(int codeSize) {
clearCode = (1 << (codeSize - 1));
@@ -106,6 +113,7 @@
/**
* Initializes the arrays based on the maximum code size.
+ * @param maxCodeSize maximum code size
*/
protected void initializeTables(int maxCodeSize) {
final int maxTableSize = 1 << maxCodeSize;
@@ -122,6 +130,8 @@
/**
* Reads the next code from the stream.
+ * @return the next code
+ * @throws IOException on error
*/
protected int readNextCode() throws IOException {
if (codeSize > 31) {
@@ -133,6 +143,10 @@
/**
* Adds a new entry if the maximum table size hasn't been exceeded
* and returns the new index.
+ * @param previousCode the previous code
+ * @param character the character to append
+ * @param maxTableSize the maximum table size
+ * @return the new code
*/
protected int addEntry(int previousCode, byte character, int maxTableSize) {
if (tableSize < maxTableSize) {
@@ -145,6 +159,8 @@
/**
* Add entry for repeat of previousCode we haven't added, yet.
+ * @return new code for a repeat of the previous code
+ * @throws IOException on error
*/
protected int addRepeatOfPreviousCode() throws IOException {
if (previousCode == -1) {
@@ -157,6 +173,10 @@
/**
* Expands the entry with index code to the output stack and may
* create a new entry
+ * @param code the code
+ * @param addedUnfinishedEntry whether unfinished entries have been added
+ * @return the new location of the output stack
+ * @throws IOException on error
*/
protected int expandCodeToOutputStack(int code, boolean addedUnfinishedEntry)
throws IOException {
diff --git a/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorInputStream.java
index 9711a0c..d88be88 100644
--- a/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorInputStream.java
@@ -52,6 +52,7 @@
* provide better performance.</p>
*
* @param in the InputStream from which this object should be created
+ * @throws IOException if reading fails
*/
public Pack200CompressorInputStream(final InputStream in)
throws IOException {
@@ -67,6 +68,7 @@
*
* @param in the InputStream from which this object should be created
* @param mode the strategy to use
+ * @throws IOException if reading fails
*/
public Pack200CompressorInputStream(final InputStream in,
final Pack200Strategy mode)
@@ -83,6 +85,7 @@
*
* @param in the InputStream from which this object should be created
* @param props Pack200 properties to use
+ * @throws IOException if reading fails
*/
public Pack200CompressorInputStream(final InputStream in,
final Map<String, String> props)
@@ -100,6 +103,7 @@
* @param in the InputStream from which this object should be created
* @param mode the strategy to use
* @param props Pack200 properties to use
+ * @throws IOException if reading fails
*/
public Pack200CompressorInputStream(final InputStream in,
final Pack200Strategy mode,
@@ -113,6 +117,7 @@
* memory.
*
* @param f the file to decompress
+ * @throws IOException if reading fails
*/
public Pack200CompressorInputStream(final File f) throws IOException {
this(f, Pack200Strategy.IN_MEMORY);
@@ -124,6 +129,7 @@
*
* @param f the file to decompress
* @param mode the strategy to use
+ * @throws IOException if reading fails
*/
public Pack200CompressorInputStream(final File f, final Pack200Strategy mode)
throws IOException {
@@ -136,6 +142,7 @@
*
* @param f the file to decompress
* @param props Pack200 properties to use
+ * @throws IOException if reading fails
*/
public Pack200CompressorInputStream(final File f,
final Map<String, String> props)
@@ -150,6 +157,7 @@
* @param f the file to decompress
* @param mode the strategy to use
* @param props Pack200 properties to use
+ * @throws IOException if reading fails
*/
public Pack200CompressorInputStream(final File f, final Pack200Strategy mode,
final Map<String, String> props)
diff --git a/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorOutputStream.java b/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorOutputStream.java
index 9ecf6eb..80da616 100644
--- a/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorOutputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200CompressorOutputStream.java
@@ -45,6 +45,7 @@
* memory.
*
* @param out the stream to write to
+ * @throws IOException if writing fails
*/
public Pack200CompressorOutputStream(final OutputStream out)
throws IOException {
@@ -57,6 +58,7 @@
*
* @param out the stream to write to
* @param mode the strategy to use
+ * @throws IOException if writing fails
*/
public Pack200CompressorOutputStream(final OutputStream out,
final Pack200Strategy mode)
@@ -70,6 +72,7 @@
*
* @param out the stream to write to
* @param props Pack200 properties to use
+ * @throws IOException if writing fails
*/
public Pack200CompressorOutputStream(final OutputStream out,
final Map<String, String> props)
@@ -84,6 +87,7 @@
* @param out the stream to write to
* @param mode the strategy to use
* @param props Pack200 properties to use
+ * @throws IOException if writing fails
*/
public Pack200CompressorOutputStream(final OutputStream out,
final Pack200Strategy mode,
diff --git a/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200Utils.java b/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200Utils.java
index 1f944da..b76c75b 100644
--- a/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200Utils.java
+++ b/src/main/java/org/apache/commons/compress/compressors/pack200/Pack200Utils.java
@@ -53,6 +53,7 @@
* -1.</p>
*
* @param jar the JAR archive to normalize
+ * @throws IOException if reading or writing fails
*/
public static void normalize(File jar)
throws IOException {
@@ -73,6 +74,7 @@
* @param jar the JAR archive to normalize
* @param props properties to set for the pack operation. This
* method will implicitly set the segment limit to -1.
+ * @throws IOException if reading or writing fails
*/
public static void normalize(File jar, Map<String, String> props)
throws IOException {
@@ -97,6 +99,7 @@
*
* @param from the JAR archive to normalize
* @param to the normalized archive
+ * @throws IOException if reading or writing fails
*/
public static void normalize(File from, File to)
throws IOException {
@@ -120,6 +123,7 @@
* @param to the normalized archive
* @param props properties to set for the pack operation. This
* method will implicitly set the segment limit to -1.
+ * @throws IOException if reading or writing fails
*/
public static void normalize(File from, File to, Map<String, String> props)
throws IOException {
@@ -155,4 +159,4 @@
f.delete();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStream.java
index f3db4ca..8d245d4 100644
--- a/src/main/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorInputStream.java
@@ -73,6 +73,7 @@
* Constructs a new input stream that decompresses snappy-framed-compressed data
* from the specified input stream.
* @param in the InputStream from which to read the compressed data
+ * @throws IOException if reading fails
*/
public FramedSnappyCompressorInputStream(InputStream in) throws IOException {
this.in = new PushbackInputStream(in, 1);
diff --git a/src/main/java/org/apache/commons/compress/compressors/snappy/SnappyCompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/snappy/SnappyCompressorInputStream.java
index b8887f2..92e1cbc 100644
--- a/src/main/java/org/apache/commons/compress/compressors/snappy/SnappyCompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/snappy/SnappyCompressorInputStream.java
@@ -78,7 +78,7 @@
* @param is
* An InputStream to read compressed data from
*
- * @throws IOException
+ * @throws IOException if reading fails
*/
public SnappyCompressorInputStream(final InputStream is) throws IOException {
this(is, DEFAULT_BLOCK_SIZE);
@@ -92,7 +92,7 @@
* @param blockSize
* The block size used in compression
*
- * @throws IOException
+ * @throws IOException if reading fails
*/
public SnappyCompressorInputStream(final InputStream is, final int blockSize)
throws IOException {
diff --git a/src/main/java/org/apache/commons/compress/compressors/xz/XZCompressorOutputStream.java b/src/main/java/org/apache/commons/compress/compressors/xz/XZCompressorOutputStream.java
index 0c192cc..23cda28 100644
--- a/src/main/java/org/apache/commons/compress/compressors/xz/XZCompressorOutputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/xz/XZCompressorOutputStream.java
@@ -88,6 +88,7 @@
/**
* Finishes compression without closing the underlying stream.
* No more data can be written to this stream after finishing.
+ * @throws IOException on error
*/
public void finish() throws IOException {
out.finish();
diff --git a/src/main/java/org/apache/commons/compress/parallel/ScatterGatherBackingStore.java b/src/main/java/org/apache/commons/compress/parallel/ScatterGatherBackingStore.java
index f4f243a..ea726ff 100644
--- a/src/main/java/org/apache/commons/compress/parallel/ScatterGatherBackingStore.java
+++ b/src/main/java/org/apache/commons/compress/parallel/ScatterGatherBackingStore.java
@@ -55,6 +55,7 @@
/**
* Closes this backing store for further writing.
+ * @throws IOException when something fails
*/
void closeForWriting() throws IOException;
}
diff --git a/src/main/java/org/apache/commons/compress/parallel/ScatterGatherBackingStoreSupplier.java b/src/main/java/org/apache/commons/compress/parallel/ScatterGatherBackingStoreSupplier.java
index 4bc33ce..9a216a7 100644
--- a/src/main/java/org/apache/commons/compress/parallel/ScatterGatherBackingStoreSupplier.java
+++ b/src/main/java/org/apache/commons/compress/parallel/ScatterGatherBackingStoreSupplier.java
@@ -30,6 +30,7 @@
* Create a ScatterGatherBackingStore.
*
* @return a ScatterGatherBackingStore, not null
+ * @throws IOException when something fails
*/
ScatterGatherBackingStore get() throws IOException;
}