Java Path File Write nio newBufferedWriter(Path path, OpenOption... options)

Here you can find the source of newBufferedWriter(Path path, OpenOption... options)

Description

new Buffered Writer

License

Open Source License

Declaration

public static BufferedWriter newBufferedWriter(Path path, OpenOption... options) 

Method Source Code

//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);
    }
}

Related

  1. canWrite(Path path)
  2. checkFilePermissions(final String filepath, final boolean canRead, final boolean canWrite)
  3. compareTable(final String table, final List d1, final List d2, final BufferedWriter errors)
  4. isWritePermission(Path p)
  5. newBufferedWriter(Path path)
  6. newGzipBufferedWriter(Path path)
  7. okayToOverwrite(Path file)
  8. overwriteFile(final String newFilePath, final String oldFilePath)
  9. removeMatchingLines( final Map d1LineMap, final Path tableDir, final String table, final BufferedWriter errors)