Java Stream Close closePrintWriter(PrintWriter fileOutputStream)

Here you can find the source of closePrintWriter(PrintWriter fileOutputStream)

Description

close Print Writer

License

Open Source License

Parameter

Parameter Description

Declaration

public final static void closePrintWriter(PrintWriter fileOutputStream) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.PrintWriter;

public class Main {
    /**/*from w  w  w  . j a  v  a2  s  . com*/
     * @param fileOutputStream: opened file in writing mode; it can be null
     * */
    public final static void closePrintWriter(PrintWriter fileOutputStream) {
        if (null != fileOutputStream) {
            fileOutputStream.flush();
            fileOutputStream.close();
        }
    }
}

Related

  1. closeOutputStream(OutputStream out)
  2. closeOutputStream(OutputStream out, boolean flush)
  3. closeOutputStream(OutputStream outputStream)
  4. closePermanentOutputWriter()
  5. closePort()
  6. closeProcess(Process process)
  7. closeProcessStreams(Process p)
  8. closeProofWriter(Writer out)
  9. closeProtectedStream(final OutputStream outputStream)