@Test public void testWriteLines() throws Exception { IOUtils.writeLines(os, new String[]{TEXT}); ByteArrayOutputStream bos = (ByteArrayOutputStream) os; assertThat(new String(bos.toByteArray()), equalTo(TEXT + "\n")); }
public static void writeLines(OutputStream os, String[] lines) throws IOException { PrintWriter writer = new PrintWriter(new OutputStreamWriter(os)); try { for (String line : lines) writer.println(line); writer.flush(); } finally { writer.close(); } }
IOUtils { public static void writeLines(OutputStream os, String[] lines) throws IOException { PrintWriter writer = new PrintWriter(new OutputStreamWriter(os)); try { for (String line : lines) writer.println(line); writer.flush(); } finally { writer.close(); } } }
IOUtils { public static void writeLines(OutputStream os, String[] lines) throws IOException { PrintWriter writer = new PrintWriter(new OutputStreamWriter(os)); try { for (String line : lines) writer.println(line); writer.flush(); } finally { writer.close(); } } private  IOUtils(); }
IOUtils { public static void writeLines(OutputStream os, String[] lines) throws IOException { PrintWriter writer = new PrintWriter(new OutputStreamWriter(os)); try { for (String line : lines) writer.println(line); writer.flush(); } finally { writer.close(); } } private  IOUtils(); static long write(InputStream is, OutputStream os); static long write(InputStream is, OutputStream os, int bufferSize); 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); }
IOUtils { public static void writeLines(OutputStream os, String[] lines) throws IOException { PrintWriter writer = new PrintWriter(new OutputStreamWriter(os)); try { for (String line : lines) writer.println(line); writer.flush(); } finally { writer.close(); } } private  IOUtils(); static long write(InputStream is, OutputStream os); static long write(InputStream is, OutputStream os, int bufferSize); 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);  }