Here you can find the source of closeQuietly(BufferedReader br)
public static void closeQuietly(BufferedReader br)
//package com.java2s; /**/*from www. j a va2 s.c om*/ * Copyright (c) 2015-2017 Inria * <p> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * <p> * Contributors: * - Christophe Gourdin <christophe.gourdin@inria.fr> */ import java.io.*; public class Main { /** * Close quietly an inputstream without exception thrown. * * @param in */ public static void closeQuietly(InputStream in) { if (in != null) { try { in.close(); } catch (IOException e) { /* ignore */ } } } public static void closeQuietly(BufferedReader br) { if (br != null) { try { br.close(); } catch (IOException e) { /* ignore */ } } } public static void closeQuietly(Reader r) { if (r != null) { try { r.close(); } catch (IOException e) { /* ignore */ } } } /** * Close quietly an outputstream without exception thrown. * * @param os */ public static void closeQuietly(OutputStream os) { if (os != null) { try { os.close(); } catch (IOException e) { /* ignore */ } } } }