Here you can find the source of close(BufferedReader br)
Parameter | Description |
---|---|
br | the br |
Parameter | Description |
---|---|
IOException | the io exception |
public static void close(BufferedReader br) throws IOException
//package com.java2s; //License from project: Apache License import java.io.*; public class Main { /**// www . j a va 2 s . c om * Close. * * @param in the in * @throws IOException the io exception */ public static void close(InputStream in) throws IOException { if (in == null) { return; } try { in.close(); } catch (IOException e) { throw e; } } /** * Close. * * @param out the out * @throws IOException the io exception */ public static void close(OutputStream out) throws IOException { if (out == null) { return; } try { out.close(); } catch (IOException e) { throw e; } } /** * Close. * * @param in the in * @param out the out * @throws IOException the io exception */ public static void close(InputStream in, OutputStream out) throws IOException { try { close(in); } catch (IOException e) { throw e; } finally { try { close(out); } catch (IOException e) { throw e; } } } /** * Close. * * @param br the br * @throws IOException the io exception */ public static void close(BufferedReader br) throws IOException { if (br == null) { return; } try { br.close(); } catch (IOException e) { throw e; } } /** * Close. * * @param bw the bw * @throws IOException the io exception */ public static void close(BufferedWriter bw) throws IOException { if (bw == null) { return; } try { bw.close(); } catch (IOException e) { throw e; } } /** * Close. * * @param in the in * @param out the out * @throws IOException the io exception */ public static void close(BufferedReader in, BufferedWriter out) throws IOException { try { close(in); } catch (IOException e) { throw e; } finally { try { close(out); } catch (IOException e) { throw e; } } } }