Code example for Closeable

Methods: close

0
   * if {@code closeable} is null. 
   */ 
  public static void closeQuietly(Closeable closeable) {
    if (closeable != null) {
      try { 
        closeable.close();
      } catch (RuntimeException rethrown) {
        throw rethrown;
      } catch (Exception ignored) {
      } 
    } 
  } 
 
  /** 
   * Closes {@code socket}, ignoring any checked exceptions. Does nothing if 
   * {@code socket} is null. 
   */ 
  public static void closeQuietly(Socket socket) {
    if (socket != null) {
      try { 
        socket.close();