Here you can find the source of getBufferedWriter(File file)
Parameter | Description |
---|---|
file | a parameter |
Parameter | Description |
---|---|
FileNotFoundException | an exception |
public static BufferedWriter getBufferedWriter(File file) 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; public class Main { /**/*w w w.j a va 2 s. c o m*/ * Creates a buffered writer for a specified file. * @param file * @return A BufferedWriter for the specified File. * @throws FileNotFoundException */ public static BufferedWriter getBufferedWriter(File file) throws FileNotFoundException { FileOutputStream fos = new FileOutputStream(file); OutputStreamWriter osw = new OutputStreamWriter(fos); BufferedWriter bw = new BufferedWriter(osw); return bw; } }