Here you can find the source of writerBuffered(final File file, final Charset charset)
Parameter | Description |
---|---|
file | the file to open |
charset | the charset to decode the file contents |
Parameter | Description |
---|---|
FileNotFoundException | if the file could not be opened |
public static final BufferedWriter writerBuffered(final File file, final Charset charset) throws FileNotFoundException
//package com.java2s; //License from project: Open Source License import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.OutputStreamWriter; import java.nio.charset.Charset; public class Main { /** Open a buffered {@link Writer}, equivalent to:<br/> * {@code new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), charset));} * @param file the file to open/*from w w w . j a v a 2 s. co m*/ * @param charset the charset to decode the file contents * @return the buffered reader from the file * @throws FileNotFoundException if the file could not be opened */ public static final BufferedWriter writerBuffered(final File file, final Charset charset) throws FileNotFoundException { BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), charset)); return writer; } }