Java Stream Close closeFile(final Closeable p_closeable)

Here you can find the source of closeFile(final Closeable p_closeable)

Description

close File

License

Open Source License

Declaration

private static void closeFile(final Closeable p_closeable) throws IOException 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2011 Lab-STICC Universite de Bretagne Sud, Lorient.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the CeCILL-B license available
 * at ://from   www. ja  v  a  2s . co m
 * en : http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
 * fr : http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.html
 * 
 * Contributors:
 * Dominique BLOUIN (Lab-STICC UBS), dominique.blouin@univ-ubs.fr
 ******************************************************************************/

import java.io.Closeable;

import java.io.IOException;

public class Main {
    private static void closeFile(final Closeable p_closeable) throws IOException {
        if (p_closeable != null) {
            p_closeable.close();
        }
    }
}

Related

  1. closeFile()
  2. closeFile()
  3. closeFile(File file, boolean toBeDeleted)
  4. closeFile(File file, RandomAccessFile raf)
  5. closeFile(FileWriter fw)
  6. closeFile(PrintStream ps)
  7. closeFile(RandomAccessFile file)
  8. closeFiles(Closeable... closeables)
  9. closeFileWriter(BufferedWriter bw)