@Test public void testCopyExactFull() 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(); IOUtils.copy(in, out, buf, 10000); assertArrayEquals("seed == " + seed, expected, out.toByteArray()); }
public static int copy(InputStream in, OutputStream out, byte[] buffer) throws IOException { final long count = copyLarge(in, out, buffer); return count > Integer.MAX_VALUE ? -1 : (int) count; }
IOUtils extends org.apache.commons.io.IOUtils { public static int copy(InputStream in, OutputStream out, byte[] buffer) throws IOException { final long count = copyLarge(in, out, buffer); return count > Integer.MAX_VALUE ? -1 : (int) count; } }
IOUtils extends org.apache.commons.io.IOUtils { public static int copy(InputStream in, OutputStream out, byte[] buffer) throws IOException { final long count = copyLarge(in, out, buffer); return count > Integer.MAX_VALUE ? -1 : (int) count; } protected  IOUtils(); }
IOUtils extends org.apache.commons.io.IOUtils { public static int copy(InputStream in, OutputStream out, byte[] buffer) throws IOException { final long count = copyLarge(in, out, buffer); return count > Integer.MAX_VALUE ? -1 : (int) 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); }
IOUtils extends org.apache.commons.io.IOUtils { public static int copy(InputStream in, OutputStream out, byte[] buffer) throws IOException { final long count = copyLarge(in, out, buffer); return count > Integer.MAX_VALUE ? -1 : (int) 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);  }