* Test for files > 2GB in size - see issue IO-84
*/
public void testLargeFiles_IO84() throws Exception {
long size = (long)Integer.MAX_VALUE + (long)1;
NullInputStream mock = new NullInputStream(size);
OutputStream nos = new NullOutputStream();
CountingOutputStream cos = new CountingOutputStream(nos);
// Test integer methods
IOUtils.copyLarge(mock, cos);
try {
cos.getCount();
fail("Expected getCount() to throw an ArithmeticException");
} catch (ArithmeticException ae) {
// expected result
}
try {
cos.resetCount();
fail("Expected resetCount() to throw an ArithmeticException");
} catch (ArithmeticException ae) {
// expected result
}
mock.close();
// Test long methods
IOUtils.copyLarge(mock, cos);
assertEquals("getByteCount()", size, cos.getByteCount());
assertEquals("resetByteCount()", size, cos.resetByteCount());