You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/12/26 19:08:47 UTC

(commons-io) branch master updated: Deprecate int CountingInputStream#getCount() in favor of long CountingInputStream#getByteCount()

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-io.git


The following commit(s) were added to refs/heads/master by this push:
     new 75750db9 Deprecate int CountingInputStream#getCount() in favor of long CountingInputStream#getByteCount()
75750db9 is described below

commit 75750db98e903c48e24f0cefe827b54c90160770
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Dec 26 14:08:42 2023 -0500

    Deprecate int CountingInputStream#getCount() in favor of long
    CountingInputStream#getByteCount()
---
 src/changes/changes.xml                                            | 1 +
 src/main/java/org/apache/commons/io/input/CountingInputStream.java | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 95bbf173..3adf2202 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -78,6 +78,7 @@ The <action> type attribute can be add,update,fix,remove.
       <action dev="ggregory" type="fix"                due-to="Elliotte Rusty Harold, Gary Gregory">Modernize temporary file creation and deletion in DeferredFileOutputStreamTest #535.</action>
       <action dev="ggregory" type="fix"                due-to="Elliotte Rusty Harold">Add PathMatcher to IOFileFilter class Javadoc #536.</action>
       <action dev="ggregory" type="fix" issue="IO-781" due-to="Marcono1234">Fix CharSequenceInputStream coding exception handling #537.</action>
+      <action dev="ggregory" type="fix" issue="IO-781" due-to="Marcono1234">Deprecate int CountingInputStream#getCount() in favor of long CountingInputStream#getByteCount().</action>
       <!-- Add -->
       <action dev="ggregory" type="add"                due-to="Gary Gregory">Add and use PathUtils.getFileName(Path, Function&lt;Path, R&gt;).</action>
       <action dev="ggregory" type="add"                due-to="Gary Gregory">Add and use PathUtils.getFileNameString().</action>
diff --git a/src/main/java/org/apache/commons/io/input/CountingInputStream.java b/src/main/java/org/apache/commons/io/input/CountingInputStream.java
index 87827b4f..ec262a7b 100644
--- a/src/main/java/org/apache/commons/io/input/CountingInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/CountingInputStream.java
@@ -81,7 +81,9 @@ public class CountingInputStream extends ProxyInputStream {
      *
      * @return the number of bytes accumulated
      * @throws ArithmeticException if the byte count is too large
+     * @deprecated Use {@link #getByteCount()}.
      */
+    @Deprecated
     public int getCount() {
         final long result = getByteCount();
         if (result > Integer.MAX_VALUE) {