Here you can find the source of newBufferedWriter(Path path, OpenOption... options)
public static BufferedWriter newBufferedWriter(Path path, OpenOption... options)
//package com.java2s; //License from project: Open Source License import java.io.BufferedWriter; import java.io.IOException; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.OpenOption; import java.nio.file.Path; public class Main { public static BufferedWriter newBufferedWriter(Path path, Charset cs, OpenOption... options) { try {/*from w w w .j a v a2 s. co m*/ return Files.newBufferedWriter(path, cs, options); } catch (IOException e) { throw new RuntimeException(e); } } public static BufferedWriter newBufferedWriter(Path path, OpenOption... options) { return newBufferedWriter(path, StandardCharsets.UTF_8, options); } }