Java PrintWriter Create getPrintWriter(String fileName, Writer out)

Here you can find the source of getPrintWriter(String fileName, Writer out)

Description

get Print Writer

License

Apache License

Declaration

public static PrintWriter getPrintWriter(String fileName, Writer out) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.*;

public class Main {
    public static PrintWriter getPrintWriter(String fileName, Writer out) throws IOException {
        if (fileName == null)
            return null;
        Writer writer = fileName.equals("-") ? out : new BufferedWriter(new FileWriter(fileName));
        return new PrintWriter(writer);
    }//from  w  w w. j  a v a2  s .c  om
}

Related

  1. getPrintWriter(File file)
  2. getPrintWriter(File file)
  3. getPrintwriter(File file, boolean append)
  4. getPrintWriter(final File aFile, final boolean append)
  5. getPrintWriter(String filename)
  6. getPrintWriter(String nombreFichero)
  7. getPrintWriter(String path, String charset, boolean isAppend)