Java tutorial
//package com.java2s; import java.io.BufferedReader; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Main { public static void close(BufferedReader reader) { try { reader.close(); } catch (IOException e) { e.printStackTrace(); } } public static void close(FileWriter fileWriter) { try { fileWriter.close(); } catch (IOException e) { e.printStackTrace(); } } public static void close(OutputStream outputStream) { try { outputStream.close(); } catch (IOException e) { e.printStackTrace(); } } public static void close(InputStream inputStream) { try { inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } }