Java Stream Close closeBufferedFile(BufferedReader reader)

Here you can find the source of closeBufferedFile(BufferedReader reader)

Description

close Buffered File

License

Open Source License

Declaration

public static void closeBufferedFile(BufferedReader reader) 

Method Source Code


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

import java.io.*;

public class Main {
    public static void closeBufferedFile(BufferedReader reader) {
        try {/*from w  w  w.j  a v a 2s  . c o  m*/
            if (reader != null)
                reader.close();
        } catch (IOException e) {
            throw new RuntimeException("Cannot close file. " + e.getMessage());
        }
    }
}

Related

  1. closeAll(Exception firstEx, Closeable... objects)
  2. closeAll(Iterable closeables)
  3. closeAll(T... io)
  4. closeAllStreamsQuietly(final Closeable... closeables)
  5. closeAndRethrow(final Exception e, final Closeable... channels)
  6. closeBufferedReader(BufferedReader bufferedReader)
  7. closeCloseableIfNotNull(Closeable fileWriter)
  8. closeConnection(Closeable... closes)
  9. closeDataLine(final SourceDataLine line, final AudioInputStream ais)