@Test public void testReadFull() throws IOException { final byte[] expected = new byte[100]; Arrays.fill(expected, (byte) 1); final InputStream in = new ByteArrayInputStream(expected); final byte[] actual = new byte[100]; final int count = IOUtils.read(in, actual); assertEquals(expected.length, count); assertArrayEquals(expected, actual); }
public static int read(InputStream in, byte[] buf) throws IOException { int num; int off = 0; while (off < buf.length && (num = in.read(buf, off, buf.length-off)) != -1) { off += num; } return off == 0 ? -1 : off; }
IOUtils extends org.apache.commons.io.IOUtils { public static int read(InputStream in, byte[] buf) throws IOException { int num; int off = 0; while (off < buf.length && (num = in.read(buf, off, buf.length-off)) != -1) { off += num; } return off == 0 ? -1 : off; } }
IOUtils extends org.apache.commons.io.IOUtils { public static int read(InputStream in, byte[] buf) throws IOException { int num; int off = 0; while (off < buf.length && (num = in.read(buf, off, buf.length-off)) != -1) { off += num; } return off == 0 ? -1 : off; } protected  IOUtils(); }
IOUtils extends org.apache.commons.io.IOUtils { public static int read(InputStream in, byte[] buf) throws IOException { int num; int off = 0; while (off < buf.length && (num = in.read(buf, off, buf.length-off)) != -1) { off += num; } return off == 0 ? -1 : off; } 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 read(InputStream in, byte[] buf) throws IOException { int num; int off = 0; while (off < buf.length && (num = in.read(buf, off, buf.length-off)) != -1) { off += num; } return off == 0 ? -1 : off; } 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);  }