use of org.apache.commons.io.input.NullReader in project commons-io by apache.
the class IOUtilsCopyTest method testCopy_readerToAppendable_IO84.
@Test
public void testCopy_readerToAppendable_IO84() throws Exception {
final long size = (long) Integer.MAX_VALUE + (long) 1;
final Reader reader = new NullReader(size);
final NullWriter writer = new NullWriter();
// Test copy() method
assertEquals(size, IOUtils.copy(reader, (Appendable) writer));
// reset the input
reader.close();
// Test copyLarge() method
assertEquals(size, IOUtils.copyLarge(reader, writer), "copy()");
}
use of org.apache.commons.io.input.NullReader in project commons-io by apache.
the class IOUtilsCopyTest method testCopy_readerToWriter_IO84.
/*
* Test Copying file > 2GB - see issue# IO-84
*/
@Test
public void testCopy_readerToWriter_IO84() throws Exception {
final long size = (long) Integer.MAX_VALUE + (long) 1;
final Reader reader = new NullReader(size);
final Writer writer = new NullWriter();
// Test copy() method
assertEquals(-1, IOUtils.copy(reader, writer));
// reset the input
reader.close();
// Test copyLarge() method
assertEquals(size, IOUtils.copyLarge(reader, writer), "copyLarge()");
}
Aggregations