public static PrintWriter writer(OutputStream out) { return writer(out, UTF_8); }
public static OutputStream copy(Collection<?> c, OutputStream out) throws IOException { PrintWriter pw = writer(out); try { for (Object o : c) { pw.println(o); } return out; } finally { pw.flush(); } }
public static OutputStream copy(Collection<?> c, OutputStream out) throws IOException { PrintWriter pw = writer(out); try { for (Object o : c) { pw.println(o); } return out; } finally { pw.flush(); } }
public static OutputStream copy(Collection<?> c, OutputStream out) throws IOException { PrintWriter pw = writer(out); try { for (Object o : c) { pw.println(o); } return out; } finally { pw.flush(); } }
public static OutputStream copy(Collection<?> c, OutputStream out) throws IOException { PrintWriter pw = writer(out); try { for (Object o : c) { pw.println(o); } return out; } finally { pw.flush(); } }
public ResolverLogger(int level) { try { this.level = level; file = File.createTempFile("tmp", ".log"); file.deleteOnExit(); printer = IO.writer(file, UTF_8); } catch (IOException e) { throw new RuntimeException(e); } }
public static void store(Object o, OutputStream out, Charset encoding) throws IOException { Writer w = writer(out, encoding); try { store(o, w); } finally { w.flush(); } }
@Override public void write(OutputStream out) throws IOException { PrintWriter pw = IO.writer(out, UTF_8); pw.print("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); try { tag.print(0, pw); } finally { pw.flush(); } }
public static OutputStream copy(Reader r, OutputStream out, Charset charset) throws IOException { Writer w = writer(out, charset); try { copy(r, w); return out; } finally { w.flush(); } }
public static void store(Object o, OutputStream out, Charset encoding) throws IOException { Writer w = writer(out, encoding); try { store(o, w); } finally { w.flush(); } }
public static OutputStream copy(Reader r, OutputStream out, Charset charset) throws IOException { Writer w = writer(out, charset); try { copy(r, w); return out; } finally { w.flush(); } }
public static OutputStream copy(Reader r, OutputStream out, Charset charset) throws IOException { Writer w = writer(out, charset); try { copy(r, w); return out; } finally { w.flush(); } }
@Override public void write(OutputStream out) throws IOException { PrintWriter pw = IO.writer(out, UTF_8); pw.print("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); try { tag.print(0, pw); } finally { pw.flush(); } }
@Override public void write(OutputStream out) throws IOException { PrintWriter pw = IO.writer(out, UTF_8); pw.print("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); try { tag.print(0, pw); } finally { pw.flush(); } }
public static OutputStream copy(Reader r, OutputStream out, Charset charset) throws IOException { Writer w = writer(out, charset); try { copy(r, w); return out; } finally { w.flush(); } }
public static void store(Object o, OutputStream out, Charset encoding) throws IOException { Writer w = writer(out, encoding); try { store(o, w); } finally { w.flush(); } }
public static void store(Object o, OutputStream out, Charset encoding) throws IOException { Writer w = writer(out, encoding); try { store(o, w); } finally { w.flush(); } }
private synchronized void save() throws Exception { Path index = indexFile.toPath(); Path tmp = Files.createTempFile(IO.mkdirs(index.getParent()), "index", null); try (PrintWriter pw = IO.writer(tmp)) { archives.keySet() .stream() .sorted() .forEachOrdered(archive -> pw.println(archive)); } IO.rename(tmp, index); lastModified = indexFile.lastModified(); }
private synchronized void save() throws Exception { Path index = indexFile.toPath(); Path tmp = Files.createTempFile(IO.mkdirs(index.getParent()), "index", null); try (PrintWriter pw = IO.writer(tmp)) { archives.keySet() .stream() .sorted() .forEachOrdered(archive -> pw.println(archive)); } IO.rename(tmp, index); lastModified = indexFile.lastModified(); }
@Override public void write(OutputStream out) throws IOException { try { finish(); } catch (Exception e) { throw new RuntimeException(e); } PrintWriter pw = IO.writer(out, UTF_8); pw.print("<?xml version='1.0' encoding='UTF-8'?>\n"); metadata.print(0, pw); pw.flush(); }