RTEditor/src/main/java/com/onegravity/rteditor/utils/io/IOUtils.java
public static void writeLines(Collection<?> lines, String lineEnding,
                                  Writer writer) throws IOException {
        if (lines == null) {
            return;
        }
        if (lineEnding == null) {
            lineEnding = LINE_SEPARATOR;
        }
        for (Object line : lines) {
            if (line != null) {
                writer.write(line.toString());
            }
            writer.write(lineEnding);
        }
    }
public static void writeLines(Collection<?> lines, String lineEnding,
                                  Writer writer) throws IOException {
        if (lines == null) {
            return;
        }
        if (lineEnding == null) {
            lineEnding = LINE_SEPARATOR;
        }
        for (Object line : lines) {
            if (line != null) {
                writer.write(line.toString());
            }
            writer.write(lineEnding);
        }
    }
public static void writeLines ( Collection < ? > lines , String lineEnding , Writer writer ) throws IOException { if ( lines == null ) { return ; } if ( lineEnding == null ) { lineEnding = LINE_SEPARATOR ; } for ( Object line : lines ) { if ( line != null ) { writer . write ( line . toString ( ) ) ; } writer . write ( lineEnding ) ; } }
Writes the <code>toString()</code> value of each item in a collection to
a <code>Writer</code> line by line, using the specified line ending.

@param lines      the lines to write, null entries produce blank lines
@param lineEnding the line separator to use, null is system default
@param writer     the <code>Writer</code> to write to, not null, not closed
@throws NullPointerException if the input is null
@throws IOException          if an I/O error occurs
@since 1.1
Writes the <code > toString () < / code > value of each item in a collection to a <code > Writer< / code > line by line using the specified line ending .