Here you can find the source of close(Closeable closeable)
Parameter | Description |
---|---|
closeable | the closeable to close |
public static void close(Closeable closeable)
//package com.java2s; import java.io.Closeable; import java.io.IOException; public class Main { /**//w w w . j a va 2 s .c om * Closes a resource stream if the {@link Closeable} is not null, any exceptions will be swallowed. * * @param closeable * the closeable to close */ public static void close(Closeable closeable) { if (closeable != null) { try { closeable.close(); } catch (IOException e) { // noop } } } }