This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git

commit 60dd897f97341e2edd177cb5a8a06644da518420
Author: Gary D. Gregory <garydgreg...@gmail.com>
AuthorDate: Thu Aug 14 19:05:20 2025 -0400

    Javadoc
    
    Reduce vertical whitespace
---
 .../compressors/lz77support/LZ77Compressor.java    |  2 +-
 .../snappy/FramedSnappyCompressorInputStream.java  | 34 +++++++--------
 .../snappy/FramedSnappyCompressorOutputStream.java | 10 ++---
 .../snappy/SnappyCompressorInputStream.java        | 48 +++++++---------------
 .../snappy/SnappyCompressorOutputStream.java       | 26 ++++++------
 5 files changed, 48 insertions(+), 72 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/compress/compressors/lz77support/LZ77Compressor.java
 
b/src/main/java/org/apache/commons/compress/compressors/lz77support/LZ77Compressor.java
index 4ec694563..5ee128b1a 100644
--- 
a/src/main/java/org/apache/commons/compress/compressors/lz77support/LZ77Compressor.java
+++ 
b/src/main/java/org/apache/commons/compress/compressors/lz77support/LZ77Compressor.java
@@ -451,7 +451,7 @@ private void doCompress(final byte[] data, final int off, 
final int len) throws
      * The compressor will in turn emit at least one block ({@link EOD}) but 
potentially multiple blocks to the callback during the execution of this method.
      * </p>
      *
-     * @throws IOException if the callback throws an exception
+     * @throws IOException if the callback throws an exception.
      */
     public void finish() throws IOException {
         if (blockStart != currentPosition || lookahead > 0) {
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 d2ce21c97..f83f5251e 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
@@ -69,27 +69,23 @@ public class FramedSnappyCompressorInputStream extends 
CompressorInputStream imp
      * .sz files start with a chunk with tag 0xff and content sNaPpY.
      * </p>
      *
-     * @param signature the bytes to check
-     * @param length    the number of bytes to check
-     * @return true if this is a .sz stream, false otherwise
+     * @param signature the bytes to check.
+     * @param length    the number of bytes to check.
+     * @return true if this is a .sz stream, false otherwise.
      */
     public static boolean matches(final byte[] signature, final int length) {
-
         if (length < SZ_SIGNATURE.length) {
             return false;
         }
-
         byte[] shortenedSig = signature;
         if (signature.length > SZ_SIGNATURE.length) {
             shortenedSig = Arrays.copyOf(signature, SZ_SIGNATURE.length);
         }
-
         return Arrays.equals(shortenedSig, SZ_SIGNATURE);
     }
 
     static long unmask(long x) {
-        // ugly, maybe we should just have used ints and deal with the
-        // overflow
+        // ugly, maybe we should just have used ints and deal with the 
overflow.
         x -= MASK_OFFSET;
         x &= 0xffffFFFFL;
         return (x >> 17 | x << 15) & 0xffffFFFFL;
@@ -99,7 +95,7 @@ static long unmask(long x) {
 
     private final BoundedInputStream countingStream;
 
-    /** The underlying stream to read compressed data from */
+    /** The underlying stream to read compressed data from. */
     private final PushbackInputStream inputStream;
 
     /** The dialect to expect */
@@ -124,8 +120,8 @@ static long unmask(long x) {
      * Constructs a new input stream that decompresses 
snappy-framed-compressed data from the specified input stream using the
      * {@link FramedSnappyDialect#STANDARD} dialect.
      *
-     * @param in the InputStream from which to read the compressed data
-     * @throws IOException if reading fails
+     * @param in the InputStream from which to read the compressed data.
+     * @throws IOException if reading fails.
      */
     public FramedSnappyCompressorInputStream(final InputStream in) throws 
IOException {
         this(in, FramedSnappyDialect.STANDARD);
@@ -134,9 +130,9 @@ public FramedSnappyCompressorInputStream(final InputStream 
in) throws IOExceptio
     /**
      * 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
-     * @param dialect the dialect used by the compressed stream
-     * @throws IOException if reading fails
+     * @param in      the InputStream from which to read the compressed data.
+     * @param dialect the dialect used by the compressed stream.
+     * @throws IOException if reading fails.
      */
     public FramedSnappyCompressorInputStream(final InputStream in, final 
FramedSnappyDialect dialect) throws IOException {
         this(in, SnappyCompressorInputStream.DEFAULT_BLOCK_SIZE, dialect);
@@ -145,11 +141,11 @@ public FramedSnappyCompressorInputStream(final 
InputStream in, final FramedSnapp
     /**
      * 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
-     * @param blockSize the block size to use for the compressed stream
-     * @param dialect   the dialect used by the compressed stream
-     * @throws IOException              if reading fails
-     * @throws IllegalArgumentException if blockSize is not bigger than 0
+     * @param in        the InputStream from which to read the compressed data.
+     * @param blockSize the block size to use for the compressed stream.
+     * @param dialect   the dialect used by the compressed stream.
+     * @throws IOException              if reading fails.
+     * @throws IllegalArgumentException if blockSize is not bigger than 0.
      * @since 1.14
      */
     public FramedSnappyCompressorInputStream(final InputStream in, final int 
blockSize, final FramedSnappyDialect dialect) throws IOException {
diff --git 
a/src/main/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorOutputStream.java
 
b/src/main/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorOutputStream.java
index 813848888..ce3be3c3c 100644
--- 
a/src/main/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorOutputStream.java
+++ 
b/src/main/java/org/apache/commons/compress/compressors/snappy/FramedSnappyCompressorOutputStream.java
@@ -67,8 +67,8 @@ static long mask(long x) {
     /**
      * Constructs a new output stream that compresses snappy-framed-compressed 
data to the specified output stream.
      *
-     * @param out the OutputStream to which to write the compressed data
-     * @throws IOException if writing the signature fails
+     * @param out the OutputStream to which to write the compressed data.
+     * @throws IOException if writing the signature fails.
      */
     public FramedSnappyCompressorOutputStream(final OutputStream out) throws 
IOException {
         this(out, 
SnappyCompressorOutputStream.createParameterBuilder(SnappyCompressorInputStream.DEFAULT_BLOCK_SIZE).build());
@@ -77,9 +77,9 @@ public FramedSnappyCompressorOutputStream(final OutputStream 
out) throws IOExcep
     /**
      * Constructs a new output stream that compresses snappy-framed-compressed 
data to the specified output stream.
      *
-     * @param out    the OutputStream to which to write the compressed data
+     * @param out    the OutputStream to which to write the compressed data.
      * @param params parameters used to fine-tune compression, in particular 
to balance compression ratio vs compression speed.
-     * @throws IOException if writing the signature fails
+     * @throws IOException if writing the signature fails.
      */
     public FramedSnappyCompressorOutputStream(final OutputStream out, final 
Parameters params) throws IOException {
         super(out);
@@ -100,7 +100,7 @@ public void close() throws IOException {
     /**
      * Compresses all remaining data and writes it to the stream, doesn't 
close the underlying stream.
      *
-     * @throws IOException if an error occurs
+     * @throws IOException if an error occurs.
      */
     @Override
     public void finish() throws IOException {
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 ecbc55b64..62a108ee6 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
@@ -43,19 +43,19 @@ private enum State {
         NO_BLOCK, IN_LITERAL, IN_BACK_REFERENCE
     }
 
-    /** Mask used to determine the type of "tag" is being processed */
+    /** Mask used to determine the type of "tag" is being processed. */
     private static final int TAG_MASK = 0x03;
 
-    /** Default block size */
+    /** Default block size. */
     public static final int DEFAULT_BLOCK_SIZE = 32768;
 
-    /** The size of the uncompressed data */
+    /** The size of the uncompressed data. */
     private final int size;
 
     /** Number of uncompressed bytes still to be read. */
     private int uncompressedBytesRemaining;
 
-    /** Current state of the stream */
+    /** Current state of the stream. */
     private State state = State.NO_BLOCK;
 
     private boolean endReached;
@@ -63,8 +63,8 @@ private enum State {
     /**
      * Constructor using the default buffer size of 32k.
      *
-     * @param is An InputStream to read compressed data from
-     * @throws IOException if reading fails
+     * @param is An InputStream to read compressed data from.
+     * @throws IOException if reading fails.
      */
     public SnappyCompressorInputStream(final InputStream is) throws 
IOException {
         this(is, DEFAULT_BLOCK_SIZE);
@@ -73,10 +73,10 @@ public SnappyCompressorInputStream(final InputStream is) 
throws IOException {
     /**
      * Constructor using a configurable buffer size.
      *
-     * @param is        An InputStream to read compressed data from
-     * @param blockSize The block size used in compression
-     * @throws IOException              if reading fails
-     * @throws IllegalArgumentException if blockSize is not bigger than 0
+     * @param is        An InputStream to read compressed data from.
+     * @param blockSize The block size used in compression.
+     * @throws IOException              if reading fails.
+     * @throws IllegalArgumentException if blockSize is not bigger than 0.
      */
     public SnappyCompressorInputStream(final InputStream is, final int 
blockSize) throws IOException {
         super(is, blockSize);
@@ -91,18 +91,14 @@ private void fill() throws IOException {
             endReached = true;
             return;
         }
-
         int b = readOneByte();
         if (b == -1) {
             throw new CompressorException("Premature end of stream reading 
block start");
         }
         int length = 0;
         int offset = 0;
-
         switch (b & TAG_MASK) {
-
         case 0x00:
-
             length = readLiteralLength(b);
             if (length < 0) {
                 throw new CompressorException("Illegal block with a negative 
literal size found");
@@ -111,15 +107,12 @@ private void fill() throws IOException {
             startLiteral(length);
             state = State.IN_LITERAL;
             break;
-
         case 0x01:
-
             /*
              * These elements can encode lengths between [4..11] bytes and 
offsets between [0..2047] bytes. (len-4) occupies three bits and is stored in 
bits
              * [2..4] of the tag byte. The offset occupies 11 bits, of which 
the upper three are stored in the upper three bits ([5..7]) of the tag byte, and
              * the lower eight are stored in a byte following the tag byte.
              */
-
             length = 4 + (b >> 2 & 0x07);
             uncompressedBytesRemaining -= length;
             offset = (b & 0xE0) << 3;
@@ -128,7 +121,6 @@ private void fill() throws IOException {
                 throw new CompressorException("Premature end of stream reading 
back-reference length");
             }
             offset |= b;
-
             try {
                 startBackReference(offset, length);
             } catch (final IllegalArgumentException ex) {
@@ -136,22 +128,17 @@ private void fill() throws IOException {
             }
             state = State.IN_BACK_REFERENCE;
             break;
-
         case 0x02:
-
             /*
              * These elements can encode lengths between [1..64] and offsets 
from [0..65535]. (len-1) occupies six bits and is stored in the upper six bits
              * ([2..7]) of the tag byte. The offset is stored as a 
little-endian 16-bit integer in the two bytes following the tag byte.
              */
-
             length = (b >> 2) + 1;
             if (length < 0) {
                 throw new CompressorException("Illegal block with a negative 
match length found");
             }
             uncompressedBytesRemaining -= length;
-
             offset = (int) ByteUtils.fromLittleEndian(supplier, 2);
-
             try {
                 startBackReference(offset, length);
             } catch (final IllegalArgumentException ex) {
@@ -159,22 +146,17 @@ private void fill() throws IOException {
             }
             state = State.IN_BACK_REFERENCE;
             break;
-
         case 0x03:
-
             /*
              * These are like the copies with 2-byte offsets (see previous 
subsection), except that the offset is stored as a 32-bit integer instead of a 
16-bit
              * integer (and thus will occupy four bytes).
              */
-
             length = (b >> 2) + 1;
             if (length < 0) {
                 throw new CompressorException("Illegal block with a negative 
match length found");
             }
             uncompressedBytesRemaining -= length;
-
             offset = (int) ByteUtils.fromLittleEndian(supplier, 4) & 
0x7fffffff;
-
             try {
                 startBackReference(offset, length);
             } catch (final IllegalArgumentException ex) {
@@ -189,9 +171,9 @@ private void fill() throws IOException {
     }
 
     /**
-     * Gets the uncompressed size of the stream
+     * Gets the uncompressed size of the stream.
      *
-     * @return the uncompressed size
+     * @return the uncompressed size.
      */
     @Override
     public int getSize() {
@@ -257,7 +239,6 @@ private int readLiteralLength(final int b) throws 
IOException {
             length = b >> 2;
             break;
         }
-
         return length + 1;
     }
 
@@ -266,14 +247,13 @@ private int readLiteralLength(final int b) throws 
IOException {
      * where the lower 7 bits are data and the upper bit is set iff there are 
more bytes to be read. In other words, an uncompressed length of 64 would be
      * stored as 0x40, and an uncompressed length of 2097150 (0x1FFFFE) would 
be stored as 0xFE 0xFF 0x7F.
      *
-     * @return The size of the uncompressed data
-     * @throws IOException Could not read a byte
+     * @return The size of the uncompressed data.
+     * @throws IOException Could not read a byte.
      */
     private long readSize() throws IOException {
         int index = 0;
         long sz = 0;
         int b = 0;
-
         do {
             b = readOneByte();
             if (b == -1) {
diff --git 
a/src/main/java/org/apache/commons/compress/compressors/snappy/SnappyCompressorOutputStream.java
 
b/src/main/java/org/apache/commons/compress/compressors/snappy/SnappyCompressorOutputStream.java
index f7ff8e4b2..f78e5c7fe 100644
--- 
a/src/main/java/org/apache/commons/compress/compressors/snappy/SnappyCompressorOutputStream.java
+++ 
b/src/main/java/org/apache/commons/compress/compressors/snappy/SnappyCompressorOutputStream.java
@@ -88,7 +88,7 @@ public class SnappyCompressorOutputStream extends 
CompressorOutputStream<OutputS
      * Returns a builder correctly configured for the Snappy algorithm using 
the gven block size.
      *
      * @param blockSize the block size.
-     * @return a builder correctly configured for the Snappy algorithm using 
the gven block size
+     * @return a builder correctly configured for the Snappy algorithm using 
the gven block size.
      */
     public static Parameters.Builder createParameterBuilder(final int 
blockSize) {
         // the max offset and max literal length defined by the format
@@ -107,9 +107,9 @@ public static Parameters.Builder 
createParameterBuilder(final int blockSize) {
     /**
      * Constructor using the default block size of 32k.
      *
-     * @param os               the outputstream to write compressed data to
-     * @param uncompressedSize the uncompressed size of data
-     * @throws IOException if writing of the size fails
+     * @param os               the outputstream to write compressed data to.
+     * @param uncompressedSize the uncompressed size of data.
+     * @throws IOException if writing of the size fails.
      */
     public SnappyCompressorOutputStream(final OutputStream os, final long 
uncompressedSize) throws IOException {
         this(os, uncompressedSize, 
SnappyCompressorInputStream.DEFAULT_BLOCK_SIZE);
@@ -118,10 +118,10 @@ public SnappyCompressorOutputStream(final OutputStream 
os, final long uncompress
     /**
      * Constructor using a configurable block size.
      *
-     * @param os               the outputstream to write compressed data to
-     * @param uncompressedSize the uncompressed size of data
-     * @param blockSize        the block size used - must be a power of two
-     * @throws IOException if writing of the size fails
+     * @param os               the outputstream to write compressed data to.
+     * @param uncompressedSize the uncompressed size of data.
+     * @param blockSize        the block size used - must be a power of two.
+     * @throws IOException if writing of the size fails.
      */
     public SnappyCompressorOutputStream(final OutputStream os, final long 
uncompressedSize, final int blockSize) throws IOException {
         this(os, uncompressedSize, createParameterBuilder(blockSize).build());
@@ -130,10 +130,10 @@ public SnappyCompressorOutputStream(final OutputStream 
os, final long uncompress
     /**
      * Constructor providing full control over the underlying LZ77 compressor.
      *
-     * @param out               the outputstream to write compressed data to
-     * @param uncompressedSize the uncompressed size of data
-     * @param params           the parameters to use by the compressor - note 
that the format itself imposes some limits like a maximum match length of 64 
bytes
-     * @throws IOException if writing of the size fails
+     * @param out               the outputstream to write compressed data to.
+     * @param uncompressedSize the uncompressed size of data.
+     * @param params           the parameters to use by the compressor - note 
that the format itself imposes some limits like a maximum match length of 64 
bytes.
+     * @throws IOException if writing of the size fails.
      */
     public SnappyCompressorOutputStream(final OutputStream out, final long 
uncompressedSize, final Parameters params) throws IOException {
         super(out);
@@ -165,7 +165,7 @@ public void close() throws IOException {
     /**
      * Compresses all remaining data and writes it to the stream, doesn't 
close the underlying stream.
      *
-     * @throws IOException if an error occurs
+     * @throws IOException if an error occurs.
      */
     @Override
     public void finish() throws IOException {

Reply via email to