Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update outdated descriptions in IOUtils and IOUtilsTest #612

Merged
merged 3 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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