You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2009/03/28 16:06:17 UTC
svn commit: r759478 -
/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/utils/IOUtils.java
Author: sebb
Date: Sat Mar 28 15:06:17 2009
New Revision: 759478
URL: http://svn.apache.org/viewvc?rev=759478&view=rev
Log:
Return count of bytes copied
Modified:
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/utils/IOUtils.java
Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/utils/IOUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/utils/IOUtils.java?rev=759478&r1=759477&r2=759478&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/utils/IOUtils.java (original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/utils/IOUtils.java Sat Mar 28 15:06:17 2009
@@ -39,8 +39,8 @@
* @throws IOException
* if an error occurs
*/
- public static void copy(final InputStream input, final OutputStream output) throws IOException {
- copy(input, output, 8024);
+ public static long copy(final InputStream input, final OutputStream output) throws IOException {
+ return copy(input, output, 8024);
}
/**
@@ -55,11 +55,14 @@
* @throws IOException
* if an error occurs
*/
- public static void copy(final InputStream input, final OutputStream output, int buffersize) throws IOException {
+ public static long copy(final InputStream input, final OutputStream output, int buffersize) throws IOException {
final byte[] buffer = new byte[buffersize];
int n = 0;
+ long count=0;
while (-1 != (n = input.read(buffer))) {
output.write(buffer, 0, n);
+ count += n;
}
+ return count;
}
}