### Question:
IOUtils extends org.apache.commons.io.IOUtils { public static long copyLarge(InputStream in, OutputStream out, byte[] buffer) throws IOException { long count = 0; int n = 0; while ((n = in.read(buffer)) != -1) { out.write(buffer, 0, n); count += n; } return count; } protected  IOUtils(); static int copy(InputStream in, OutputStream out, byte[] buffer); static long copyLarge(InputStream in, OutputStream out, byte[] buffer); static void copy(InputStream in, OutputStream out,
                          byte[] buffer, long length); static void closeQuietly(Closeable c); static int read(InputStream in, byte[] buf);  }### Answer:
@Test public void testCopyLargeBuffer() throws IOException { final byte[] buf = new byte[1024]; final byte[] expected = new byte[10000]; final long seed = System.currentTimeMillis(); final Random rng = new Random(seed); rng.nextBytes(expected); final ByteArrayInputStream in = new ByteArrayInputStream(expected); final ByteArrayOutputStream out = new ByteArrayOutputStream(); final long count = IOUtils.copyLarge(in, out, buf); assertEquals("seed == " + seed, expected.length, count); assertArrayEquals("seed == " + seed, expected, out.toByteArray()); }