### Question:
B2IoUtils { public static void readToEnd(InputStream in) throws IOException { readToEnd(in, new byte[4 * 1024]); }  @SuppressWarnings("UnusedReturnValue") static long copy(InputStream in,
                            OutputStream out); static void closeQuietly(Closeable closeable); static void readToEnd(InputStream in);  }### Answer:
@Test public void testReadToEnd() throws IOException { final InputStream in = new ByteArrayInputStream(makeBytes(10000)); B2IoUtils.readToEnd(in); assertEquals(-1, in.read()); in.close(); }
@Test public void testReadToEnd_hitsException() throws IOException { final InputStream in = new InputStream() { @Override public int read() throws IOException { throw new IOException("test"); } }; thrown.expect(IOException.class); thrown.expectMessage("test"); B2IoUtils.readToEnd(in); }