IOUtils { public static String read(Reader reader) throws IOException { try (StringWriter writer = new StringWriter()) { write(reader, writer); return writer.getBuffer().toString(); } } private  IOUtils(); static long write(InputStream is, OutputStream os); static long write(InputStream is, OutputStream os, int bufferSize); static long write(final InputStream input, final OutputStream output, final byte[] buffer); static String read(Reader reader); static long write(Writer writer, String string); static long write(Reader reader, Writer writer); static long write(Reader reader, Writer writer, int bufferSize); static String[] readLines(File file); static String[] readLines(InputStream is); static void writeLines(OutputStream os, String[] lines); static void writeLines(File file, String[] lines); static void appendLines(File file, String[] lines); static final int EOF; }
@Test public void testRead() throws Exception { assertThat(IOUtils.read(reader), equalTo(TEXT)); }