public NodeWriter newAppender() throws IOException { return newWriter(true); }
public NodeWriter newWriter() throws IOException { return newWriter(false); }
public void save(Gson gson, Node file) throws IOException { try (Writer writer = file.newWriter()) { gson.toJson(this, writer); } }
public T writeString(String txt) throws IOException { try (Writer w = newWriter()) { w.write(txt); } return (T) this; }
public T writeChars(char[] chars, int ofs, int len, boolean append) throws IOException { try (Writer out = newWriter(append)) { out.write(chars, ofs, len); } return (T) this; }
public T writeProperties(Properties p, String comment) throws IOException { try (Writer dest = newWriter()) { p.store(dest, comment); } return (T) this; }
protected void runQuiet(Launcher l, Node output) throws IOException { try (Writer out = output.newWriter()) { l.exec(out); } }
public void write(Node file) throws IOException { try (Writer dest = file.newWriter()) { write(dest); } }
/** @param lines without tailing line separator */ public T writeLines(Iterator<String> lines) throws IOException { return lines(newWriter(), lines); }
public T writeStrings(List<String> strings) throws IOException { return strings(newWriter(), strings); }
public static void dump(Object obj, Node dest, int maxDepth) throws IOException { try (Writer writer = dest.newWriter()) { dump(dest.getWorld(), obj, writer, maxDepth); } }
public void toXml(Node dest) throws IOException { try (NodeWriter writer = dest.newWriter()) { writer.write("<?xml version='1.0' encoding='"); writer.write(writer.getEncoding()); writer.write("'?>\n"); toXml(writer); } }