Author: norman
Date: Tue May 11 18:40:00 2010
New Revision: 943223

URL: http://svn.apache.org/viewvc?rev=943223&view=rev
Log:
fix position counting on not complete filled byte arrays. Thx to Tim-Christian 
Mundt for the patch (IMAP-144)

Modified:
    
james/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/base/FixedLengthInputStream.java

Modified: 
james/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/base/FixedLengthInputStream.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/base/FixedLengthInputStream.java?rev=943223&r1=943222&r2=943223&view=diff
==============================================================================
--- 
james/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/base/FixedLengthInputStream.java
 (original)
+++ 
james/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/base/FixedLengthInputStream.java
 Tue May 11 18:40:00 2010
@@ -60,16 +60,17 @@ public class FixedLengthInputStream exte
             return -1;
         }
 
-        if (pos + b.length >= length) {
+        if (pos + len >= length) {
             int readLimit = (int) length - (int) pos;
             pos = length;
 
             return super.read(b, off, readLimit);
         }
 
-        pos += b.length;
 
-        return super.read(b, off, len);
+        int i =  super.read(b, off, len);
+        pos += i;
+        return i;
        
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to