[ http://issues.apache.org/jira/browse/IO-84?page=comments#action_12455191 ] Stephen Colebourne commented on IO-84: --------------------------------------
I've changed IOUtils.copy to return -1 rather than an exception. The problem was that copy() was used from lots of other places, which didn't care about the number of bytes copied. As such, I reason that the most common use case for copy() is to not care about the number of bytes copied. By returning -1 from the int copy methods, the bug is dealt with (the result is now consistent and javadocced). The copyLarge() method exists for those that want accurate counts. While copy() itself will never fail to copy, as in previous versions - the most backwards compatible option. > Many classes are limited to length of stream < 2 GB, and behave incorrectly > on larger streams > --------------------------------------------------------------------------------------------- > > Key: IO-84 > URL: http://issues.apache.org/jira/browse/IO-84 > Project: Commons IO > Issue Type: Bug > Components: Utilities > Affects Versions: 1.2 > Environment: All > Reporter: Evgenii Philippov > Fix For: 1.3 > > Attachments: io-84-files-larger-than-2gb.patch > > > java int.MAX_VALUE is 2 GB. Classes that handle streams larger than 2 GB will > behave incorrectly. > For example, see > http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/IOUtils.java?view=markup > Method: int copy(InputStream input, OutputStream output). > The correct method would be: long copy(InputStream input, OutputStream > output). > This issue may affect many classes and routines. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
