commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r963161 - /commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/FromNetASCIIInputStream.java
Date Sun, 11 Jul 2010 23:15:48 GMT
Author: sebb
Date: Sun Jul 11 23:15:47 2010
New Revision: 963161

URL: http://svn.apache.org/viewvc?rev=963161&view=rev
Log:
NET-328 FromNetASCIIInputStream.read(byte[], int, int) may change length passed to superclass
if not doing conversion

Modified:
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/FromNetASCIIInputStream.java

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/FromNetASCIIInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/FromNetASCIIInputStream.java?rev=963161&r1=963160&r2=963161&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/FromNetASCIIInputStream.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/io/FromNetASCIIInputStream.java
Sun Jul 11 23:15:47 2010
@@ -156,11 +156,14 @@ public final class FromNetASCIIInputStre
     @Override
     public int read(byte buffer[], int offset, int length) throws IOException
     {
-        int ch, off;
+        if (_noConversionRequired)
+            return super.read(buffer, offset, length);
 
         if (length < 1)
             return 0;
 
+        int ch, off;
+
         ch = available();
 
         __length = (length > ch ? ch : length);
@@ -169,8 +172,6 @@ public final class FromNetASCIIInputStre
         if (__length < 1)
             __length = 1;
 
-        if (_noConversionRequired)
-            return super.read(buffer, offset, __length);
 
         if ((ch = __read()) == -1)
             return -1;



Mime
View raw message