@Test public void testReadClosed() throws IOException { final InputStream in = new ClosedInputStream(); final byte[] buf = new byte[1]; final int count = IOUtils.read(in, buf); assertEquals(-1, count); assertArrayEquals(new byte[1], buf); }
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);  }