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