Here you can find the source of closeWithoutError(Object close)
Parameter | Description |
---|---|
close | a parameter |
public static void closeWithoutError(Object close)
//package com.java2s; import java.io.Closeable; public class Main { /**/* w w w . j a v a2 s.co m*/ * close the Closeable object, without any exception. * @param close * @author <a href="mailto:iffiff1@gmail.com">Tyler Chen</a> * @since Aug 18, 2015 */ public static void closeWithoutError(Object close) { try { if (close == null) { return; } if (close instanceof Closeable) { ((Closeable) close).close(); } } catch (Exception e) { } } }