@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);
}