Java Stream Close closeOutputFile(Writer pWriter)

Here you can find the source of closeOutputFile(Writer pWriter)

Description

closes the outputfile

License

Open Source License

Declaration

public static void closeOutputFile(Writer pWriter) 

Method Source Code

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

import java.io.IOException;

import java.io.Writer;

public class Main {
    /**//w ww  .ja va2 s  . c o m
     * closes the outputfile
     */
    public static void closeOutputFile(Writer pWriter) {
        if (null != pWriter) {
            try {
                pWriter.flush();
            } catch (IOException e) {
                e.printStackTrace();
            }
            try {
                pWriter.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

    }
}

Related

  1. closeLog()
  2. closeNoException(Closeable... closeables)
  3. closeNoExceptions(Reader reader)
  4. closeNoThrow(InputStream s)
  5. closeOutput(OutputStream stream)
  6. closeOutputStream(OutputStream out)
  7. closeOutputStream(OutputStream out, boolean flush)
  8. closeOutputStream(OutputStream outputStream)
  9. closePermanentOutputWriter()