Java tutorial
//package com.java2s; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.IOException; public class Main { public static void close(BufferedInputStream inputStream) { try { inputStream.close(); inputStream = null; } catch (IOException e) { e.printStackTrace(); } } public static void close(BufferedOutputStream outputStream) { try { outputStream.close(); outputStream = null; } catch (IOException e) { e.printStackTrace(); } } }