Skip to content

Commit

Permalink
Update outdated descriptions in IOUtils and IOUtilsTest (#612)
Browse files Browse the repository at this point in the history
* Update outdated descriptions in IOUtils and IOUtilsTest

* update javadoc

* update javadoc
  • Loading branch information
Glavo authored Nov 22, 2024
1 parent 83a60ef commit 6dff447
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src/main/java/org/apache/commons/compress/utils/IOUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ public static void copy(final File sourceFile, final OutputStream outputStream)
}

/**
* Copies the content of a InputStream into an OutputStream. Uses a default buffer size of 8024 bytes.
* Copies the content of a InputStream into an OutputStream. Uses a default buffer size of 8192 bytes.
*
* @param input the InputStream to copy
* @param output the target, may be null to simulate output to dev/null on Linux and NUL on Windows
* @return the number of bytes copied
* @param output the target
* @return the number of bytes copied, or -1 if greater than {@link Integer#MAX_VALUE}
* @throws IOException if an error occurs
* @throws NullPointerException if the {@code input} or the {@code output} is {@code null}
* @deprecated Use {@link org.apache.commons.io.IOUtils#copy(InputStream, OutputStream)}.
*/
@Deprecated
Expand All @@ -90,11 +91,11 @@ public static long copy(final InputStream input, final OutputStream output) thro
* Copies the content of a InputStream into an OutputStream
*
* @param input the InputStream to copy
* @param output the target, may be null to simulate output to dev/null on Linux and NUL on Windows
* @param output the target
* @param bufferSize the buffer size to use, must be bigger than 0
* @return the number of bytes copied
* @throws IOException if an error occurs
* @throws IllegalArgumentException if bufferSize is smaller than or equal to 0
* @throws NullPointerException if the {@code input} or the {@code output} is {@code null}
* @deprecated Use {@link org.apache.commons.io.IOUtils#copy(InputStream, OutputStream, int)}.
*/
@Deprecated
Expand All @@ -103,7 +104,7 @@ public static long copy(final InputStream input, final OutputStream output, fina
}

/**
* Copies part of the content of a InputStream into an OutputStream. Uses a default buffer size of 8024 bytes.
* Copies part of the content of a InputStream into an OutputStream. Uses a default buffer size of 8192 bytes.
*
* @param input the InputStream to copy
* @param output the target Stream
Expand Down Expand Up @@ -291,7 +292,7 @@ public static long skip(final InputStream input, final long toSkip) throws IOExc
* @param input the {@code InputStream} to read from
* @return the requested byte array
* @throws NullPointerException if the input is null
* @throws IOException if an I/O error occurs
* @throws IOException if an I/O error occurs or reads more than {@link Integer#MAX_VALUE} occurs
* @since 1.5
* @deprecated Use {@link org.apache.commons.io.IOUtils#toByteArray(InputStream)}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void testCopyRangeThrowsOnZeroBufferSize() {
}

@Test
public void testCopyThrowsOnZeroBufferSize() throws IOException {
public void testCopyOnZeroBufferSize() throws IOException {
assertEquals(0, IOUtils.copy(new ByteArrayInputStream(ByteUtils.EMPTY_BYTE_ARRAY), new ByteArrayOutputStream(), 0));
}

Expand Down

0 comments on commit 6dff447

Please sign in to comment.