Here you can find the source of close(OutputStream os)
Parameter | Description |
---|---|
os | The output stream to close. |
Parameter | Description |
---|---|
IOException | When an I/O exception occurs. |
public static void close(OutputStream os) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.OutputStream; import java.io.PrintStream; public class Main { /**//w w w .j a va 2s. c o m * Close output streams that are not print streams. * * @param os * The output stream to close. * * @throws IOException * When an I/O exception occurs. * * @see PrintStream */ public static void close(OutputStream os) throws IOException { if (!(os instanceof PrintStream)) { os.close(); } } }