MCPcopy Create free account
hub / github.com/VolmitSoftware/Adapt / writeLines

Method writeLines

src/main/java/com/volmit/adapt/util/IO.java:1145–1159  ·  view source on GitHub ↗

Writes the toString() value of each item in a collection to an OutputStream line by line, using the default character encoding of the platform and the specified line ending. @param lines the lines to write, null entries produce blank lines @param lineEnding the line s

(Collection<String> lines, String lineEnding, OutputStream output)

Source from the content-addressed store, hash-verified

1143 * @since Commons IO 1.1
1144 */
1145 public static void writeLines(Collection<String> lines, String lineEnding, OutputStream output) throws IOException {
1146 if (lines == null) {
1147 return;
1148 }
1149 if (lineEnding == null) {
1150 lineEnding = LINE_SEPARATOR;
1151 }
1152 for (Iterator<String> it = lines.iterator(); it.hasNext(); ) {
1153 Object line = it.next();
1154 if (line != null) {
1155 output.write(line.toString().getBytes());
1156 }
1157 output.write(lineEnding.getBytes());
1158 }
1159 }
1160
1161 /**
1162 * Writes the <code>toString()</code> value of each item in a collection to an

Callers

nothing calls this directly

Calls 5

hasNextMethod · 0.65
nextMethod · 0.65
writeMethod · 0.65
iteratorMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected