Author: sebb
Date: Thu Mar  1 16:03:53 2012
New Revision: 1295645

URL: http://svn.apache.org/viewvc?rev=1295645&view=rev
Log:
IO-273 BoundedInputStream.read() treats max differently from 
BoundedInputStream.read(byte[]...)

Modified:
    commons/proper/io/trunk/src/changes/changes.xml
    
commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/BoundedInputStream.java

Modified: commons/proper/io/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/io/trunk/src/changes/changes.xml?rev=1295645&r1=1295644&r2=1295645&view=diff
==============================================================================
--- commons/proper/io/trunk/src/changes/changes.xml (original)
+++ commons/proper/io/trunk/src/changes/changes.xml Thu Mar  1 16:03:53 2012
@@ -40,6 +40,9 @@ The <action> type attribute can be add,u
 
   <body>
     <release version="2.2" date="TBA">
+      <action dev="sebb" type="fix" issue="IO-273" due-to="sebb">
+        BoundedInputStream.read() treats max differently from 
BoundedInputStream.read(byte[]...)
+      </action>        
       <action dev="sebb" type="add" issue="IO-297" due-to="Oleg Kalnichevski">
         CharSequenceInputStream to efficiently stream content of a CharSequence
       </action>        

Modified: 
commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/BoundedInputStream.java
URL: 
http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/BoundedInputStream.java?rev=1295645&r1=1295644&r2=1295645&view=diff
==============================================================================
--- 
commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/BoundedInputStream.java
 (original)
+++ 
commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/BoundedInputStream.java
 Thu Mar  1 16:03:53 2012
@@ -83,7 +83,7 @@ public class BoundedInputStream extends 
      */
     @Override
     public int read() throws IOException {
-        if (max>=0 && pos==max) {
+        if (max >= 0 && pos >= max) {
             return -1;
         }
         int result = in.read();


Reply via email to