public PrintWriter (String fileName, String csn) throws FileNotFoundException, UnsupportedEncodingException

Creates a new PrintWriter, without automatic line flushing, with the specified file name and charset. This convenience constructor creates the necessary intermediate OutputStreamWriter, which will encode characters using the provided charset.

fileName     The name of the file to use as the destination of this writer. If the file exists then it will be truncated to zero size; otherwise, a new file will be created. The output will be written to the file and is buffered.
csn     The name of a supported charset

FileNotFoundException     If the given string does not denote an existing, writable regular file and a new regular file of that name cannot be created, or if some other error occurs while opening or creating the file
SecurityException     If a security manager is present and checkWrite(fileName) denies write access to the file
UnsupportedEncodingException     If the named charset is not supported

Since:  1.5