Here you can find the source of closeOutputStream(OutputStream out)
Parameter | Description |
---|---|
out | the OutputStream to close. |
public static void closeOutputStream(OutputStream out)
//package com.java2s; import java.io.OutputStream; public class Main { /**//from w ww . jav a 2 s .c om * Closes and flushes the given OutputStream. * * @param out the OutputStream to close. */ public static void closeOutputStream(OutputStream out) { if (out != null) { try { out.flush(); } catch (Exception ex) { ex.printStackTrace(); } try { out.close(); } catch (Exception ex) { ex.printStackTrace(); } } } }