Author: sebb
Date: Wed Oct 31 20:49:37 2012
New Revision: 1404343
URL: http://svn.apache.org/viewvc?rev=1404343&view=rev
Log:
IO-355 - document why we use read() rather than skip()
Add comments to skipFully methods
Modified:
commons/proper/io/trunk/src/main/java/org/apache/commons/io/IOUtils.java
Modified:
commons/proper/io/trunk/src/main/java/org/apache/commons/io/IOUtils.java
URL:
http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/IOUtils.java?rev=1404343&r1=1404342&r2=1404343&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/IOUtils.java
(original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/IOUtils.java
Wed Oct 31 20:49:37 2012
@@ -2382,6 +2382,11 @@ public class IOUtils {
* <p>
* This allows for the possibility that {@link InputStream#skip(long)} may
* not skip as many bytes as requested (most likely because of reaching
EOF).
+ * <p>
+ * Note that the implementation uses {@link #skip(InputStream, long)}.
+ * This means that the method may be considerably less efficient than
using the actual skip implementation,
+ * this is done to guarantee that the correct number of characters are
skipped.
+ * </p>
*
* @param input stream to skip
* @param toSkip the number of bytes to skip
@@ -2407,6 +2412,11 @@ public class IOUtils {
* <p>
* This allows for the possibility that {@link Reader#skip(long)} may
* not skip as many characters as requested (most likely because of
reaching EOF).
+ * <p>
+ * Note that the implementation uses {@link #skip(Reader, long)}.
+ * This means that the method may be considerably less efficient than
using the actual skip implementation,
+ * this is done to guarantee that the correct number of characters are
skipped.
+ * </p>
*
* @param input stream to skip
* @param toSkip the number of characters to skip