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
The following commit(s) were added to refs/heads/master by this push:
new 12cdb259b Deprecate
org.apache.commons.compress.utils.IOUtils.read(File, byte[])
12cdb259b is described below
commit 12cdb259bd0b712d3ab2ad9e10e48b90fe8c3e4c
Author: Gary Gregory <[email protected]>
AuthorDate: Sun Jan 14 16:02:33 2024 -0500
Deprecate org.apache.commons.compress.utils.IOUtils.read(File, byte[])
---
src/changes/changes.xml | 1 +
src/main/java/org/apache/commons/compress/utils/IOUtils.java | 2 ++
2 files changed, 3 insertions(+)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index c3f07bacf..460fe58bb 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -68,6 +68,7 @@ The <action> type attribute can be add,update,fix,remove.
<action type="fix" dev="ggregory" due-to="Gary Gregory">Deprecate unused
method FileNameUtils.getBaseName(String).</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory">Deprecate unused
method FileNameUtils.getExtension(String).</action>
<action type="fix" dev="ggregory" due-to="Gary
Gregory">ArchiveInputStream.BoundedInputStream.read() incorrectly adds 1 for
EOF to the bytes read count.</action>
+ <action type="fix" dev="ggregory" due-to="Gary Gregory">Deprecate
org.apache.commons.compress.utils.IOUtils.read(File, byte[]).</action>
<!-- ADD -->
<action type="add" dev="ggregory" due-to="Gary Gregory">Add
ZipFile.builder(), add ZipFile.Builder, deprecated constructors.</action>
<!-- UPDATE -->
diff --git a/src/main/java/org/apache/commons/compress/utils/IOUtils.java
b/src/main/java/org/apache/commons/compress/utils/IOUtils.java
index 9839a70d1..f7cc79451 100644
--- a/src/main/java/org/apache/commons/compress/utils/IOUtils.java
+++ b/src/main/java/org/apache/commons/compress/utils/IOUtils.java
@@ -159,7 +159,9 @@ public final class IOUtils {
* @return the number of bytes actually read
* @throws IOException on error
* @since 1.20
+ * @deprecated Use {@link Files#readAllBytes(java.nio.file.Path)}.
*/
+ @Deprecated
public static int read(final File file, final byte[] array) throws
IOException {
try (InputStream inputStream = Files.newInputStream(file.toPath())) {
return readFully(inputStream, array, 0, array.length);