/** * Writes the given lines of text to this sink with each line (including the last) terminated with * the given line separator. * * @throws IOException if an I/O error occurs while writing to this sink */ public void writeLines(Iterable<? extends CharSequence> lines, String lineSeparator) throws IOException { writeLines(lines.iterator(), lineSeparator); }
/** * Writes the given lines of text to this sink with each line (including the last) terminated with * the operating system's default line separator. This method is equivalent to {@code * writeLines(lines, System.getProperty("line.separator"))}. * * @throws IOException if an I/O error occurs while writing to this sink */ public void writeLines(Iterable<? extends CharSequence> lines) throws IOException { writeLines(lines, System.getProperty("line.separator")); }
/** * Writes the given lines of text to this sink with each line (including the last) terminated with * the operating system's default line separator. This method is equivalent to {@code * writeLines(lines, System.getProperty("line.separator"))}. * * @throws IOException if an I/O error occurs while writing to this sink * @since 22.0 */ @Beta public void writeLines(Stream<? extends CharSequence> lines) throws IOException { writeLines(lines, System.getProperty("line.separator")); }
/** * Writes the given lines of text to this sink with each line (including the last) terminated with * the given line separator. * * @throws IOException if an I/O error occurs while writing to this sink * @since 22.0 */ @Beta public void writeLines(Stream<? extends CharSequence> lines, String lineSeparator) throws IOException { writeLines(lines.iterator(), lineSeparator); }
/** * Writes the given lines of text to this sink with each line (including the last) terminated with * the operating system's default line separator. This method is equivalent to {@code * writeLines(lines, System.getProperty("line.separator"))}. * * @throws IOException if an I/O error occurs while writing to this sink */ public void writeLines(Iterable<? extends CharSequence> lines) throws IOException { writeLines(lines, System.getProperty("line.separator")); }
/** * Writes the given lines of text to this sink with each line (including the last) terminated with * the operating system's default line separator. This method is equivalent to {@code * writeLines(lines, System.getProperty("line.separator"))}. * * @throws IOException if an I/O error occurs while writing to this sink */ public void writeLines(Iterable<? extends CharSequence> lines) throws IOException { writeLines(lines, System.getProperty("line.separator")); }
/** * Writes the given lines of text to this sink with each line (including the last) terminated with * the given line separator. * * @throws IOException if an I/O error occurs while writing to this sink */ public void writeLines(Iterable<? extends CharSequence> lines, String lineSeparator) throws IOException { writeLines(lines.iterator(), lineSeparator); }
/** * Writes the given lines of text to this sink with each line (including the last) terminated with * the given line separator. * * @throws IOException if an I/O error occurs while writing to this sink * @since 22.0 */ @Beta public void writeLines(Stream<? extends CharSequence> lines, String lineSeparator) throws IOException { writeLines(lines.iterator(), lineSeparator); }
/** * Writes the given lines of text to this sink with each line (including the last) terminated with * the operating system's default line separator. This method is equivalent to {@code * writeLines(lines, System.getProperty("line.separator"))}. * * @throws IOException if an I/O error occurs while writing to this sink * @since 22.0 */ @Beta public void writeLines(Stream<? extends CharSequence> lines) throws IOException { writeLines(lines, System.getProperty("line.separator")); }
public void testWriteLinesStream_systemDefaultSeparator() throws IOException { String separator = System.getProperty("line.separator"); sink.writeLines(lines.stream()); assertContainsExpectedLines(separator); }
public void testWriteLines_specificSeparator() throws IOException { String separator = "\r\n"; sink.writeLines(lines, separator); assertContainsExpectedLines(separator); }
public void testWriteLinesStream_specificSeparator() throws IOException { String separator = "\r\n"; sink.writeLines(lines.stream(), separator); assertContainsExpectedLines(separator); }
public void testWriteLines_systemDefaultSeparator() throws IOException { String separator = System.getProperty("line.separator"); sink.writeLines(lines); assertContainsExpectedLines(separator); }
/** * Writes the given lines of text to this sink with each line (including the last) terminated with * the given line separator. * * @throws IOException if an I/O error occurs while writing to this sink */ public void writeLines(Iterable<? extends CharSequence> lines, String lineSeparator) throws IOException { writeLines(lines.iterator(), lineSeparator); }
/** * Writes the given lines of text to this sink with each line (including the last) terminated with * the operating system's default line separator. This method is equivalent to * {@code writeLines(lines, System.getProperty("line.separator"))}. * * @throws IOException if an I/O error occurs in the process of writing to this sink */ public void writeLines(Iterable<? extends CharSequence> lines) throws IOException { writeLines(lines, System.getProperty("line.separator")); }
/** * Writes the given lines of text to this sink with each line (including the last) terminated with * the operating system's default line separator. This method is equivalent to {@code * writeLines(lines, System.getProperty("line.separator"))}. * * @throws IOException if an I/O error occurs while writing to this sink */ public void writeLines(Iterable<? extends CharSequence> lines) throws IOException { writeLines(lines, System.getProperty("line.separator")); }
/** * Writes the given lines of text to this sink with each line (including the last) terminated with * the operating system's default line separator. This method is equivalent to * {@code writeLines(lines, System.getProperty("line.separator"))}. * * @throws IOException if an I/O error occurs in the process of writing to this sink */ public void writeLines(Iterable<? extends CharSequence> lines) throws IOException { writeLines(lines, System.getProperty("line.separator")); }
public static void writeLines(String fileName,List<String> list,Charset charset) throws IOException { CharSink cs = Files.asCharSink(new File(fileName), charset); list = PojoUtil.avoidEmptyList(list); cs.writeLines(list); }
public static void writeLines(File file,List<String> list,Charset charset) throws IOException { CharSink cs = Files.asCharSink(file, charset); list = PojoUtil.avoidEmptyList(list); cs.writeLines(list); }
public void testWriteLinesStream_specificSeparator() throws IOException { String separator = "\r\n"; sink.writeLines(lines.stream(), separator); assertContainsExpectedLines(separator); }