### Question:
IO { public static byte[] readIntoByteArray(InputStream in) throws IOException { ByteArrayOutputStream content = new ByteArrayOutputStream(); pipe(in, content); return content.toByteArray(); }  static byte[] readIntoByteArray(InputStream in); static void pipe(InputStream source, OutputStream destination); static void pipe(Reader source, Writer destination); static String readIntoString(Reader reader);  }### Answer:
@Test public void testReadingFromStreamToByteArray() throws Exception { byte[] expected = "content".getBytes(); ByteArrayInputStream input = new ByteArrayInputStream(expected); byte[] actual = IO.readIntoByteArray(input); assertEquals(new String(expected), new String(actual)); }