commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Fwd: [COMPRESS] change IOUtils.copy() to return number of bytes copied?
Date Sat, 28 Mar 2009 13:57:44 GMT
Sorry, posted to wrong list (commons user) originally.

Please continue any further discussion here - thanks!

---------- Forwarded message ----------
From: Christian Grobmeier <grobmeier@gmail.com>
Date: 28 Mar 2009 12:49
Subject: Re: [COMPRESS] change IOUtils.copy() to return number of bytes copied?
To: Commons Users List <user@commons.apache.org>


> IOUtils.copy() currently returns void.
 > If it were changed to return a long of the number of bytes actually
 > copied, then it could be used in the ArchiveInputStream test cases to
 > check that the EOF was reached after the correct number of bytes. E.g.
 > that would show whether any padding was being accidentally included.
 >
 > The only use of the class in the main code is in the ChangeSet class,
 > but of course that does not have to use the return value, and the
 > "wasted" code would be minimal.
 >
 > WDYT?


I think this would make sense and feels more consistent.
 InputStream.read() returns the number of read bytes. If copy() would
 do the same, this feels good to me.

 Christian

 ---------------------------------------------------------------------
 To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
 For additional commands, e-mail: user-help@commons.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message