Streams { public static ByteArrayOutputStream read(InputStream inputStream) throws IOException { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); copy(inputStream, outputStream); return outputStream; } private  Streams(); static void copy(InputStream inputStream, OutputStream outputStream); static ByteArrayOutputStream read(InputStream inputStream);  }
@Test public void readsInputStream() throws Exception { assertArrayEquals(mBytes, read(new ByteArrayInputStream(mBytes)).toByteArray()); }