/** * Closes 'fd', ignoring any exceptions. Does nothing if 'fd' is null or invalid. */ public static void closeQuietly(FileDescriptor fd) { try { IoUtils.close(fd); } catch (IOException ignored) { } }
@Override public void close() throws IOException { try { super.close(); } finally { synchronized (this) { try { IoUtils.close(fd); } finally { fd = null; } } } } }
@Override public void close() throws IOException { try { super.close(); } finally { synchronized (this) { try { IoUtils.close(fd); } finally { fd = null; } } } } }
/** * Closes this file. * * @throws IOException * if an error occurs while closing this file. */ public void close() throws IOException { guard.close(); synchronized (this) { if (channel != null && channel.isOpen()) { channel.close(); channel = null; } IoUtils.close(fd); } }
@Override protected void implCloseSelector() throws IOException { wakeup(); synchronized (this) { synchronized (unmodifiableKeys) { synchronized (selectedKeys) { IoUtils.close(wakeupIn); IoUtils.close(wakeupOut); doCancel(); for (SelectionKey sk : mutableKeys) { deregister((AbstractSelectionKey) sk); } } } } }
@Override public void close() throws IOException { guard.close(); synchronized (this) { if (channel != null) { channel.close(); } if (shouldClose) { IoUtils.close(fd); } else { // An owned fd has been invalidated by IoUtils.close, but // we need to explicitly stop using an unowned fd (http://b/4361076). fd = new FileDescriptor(); } } }
@Override public void close() throws IOException { guard.close(); synchronized (this) { if (channel != null) { channel.close(); } if (shouldClose) { IoUtils.close(fd); } else { // An owned fd has been invalidated by IoUtils.close, but // we need to explicitly stop using an unowned fd (http://b/4361076). fd = new FileDescriptor(); } } }
IoUtils.close(fd); // TODO: should we suppress IOExceptions thrown here?
try { if (fd != null) { IoUtils.close(fd);
/** * Closes 'fd', ignoring any exceptions. Does nothing if 'fd' is null or invalid. */ public static void closeQuietly(FileDescriptor fd) { try { IoUtils.close(fd); } catch (IOException ignored) { } }
/** * Closes 'fd', ignoring any exceptions. Does nothing if 'fd' is null or invalid. */ public static void closeQuietly(FileDescriptor fd) { try { IoUtils.close(fd); } catch (IOException ignored) { } }
/** * Closes 'fd', ignoring any exceptions. Does nothing if 'fd' is null or invalid. */ public static void closeQuietly(FileDescriptor fd) { try { IoUtils.close(fd); } catch (IOException ignored) { } }
/** * Closes 'fd', ignoring any exceptions. Does nothing if 'fd' is null or invalid. */ public static void closeQuietly(FileDescriptor fd) { try { IoUtils.close(fd); } catch (IOException ignored) { } }
/** * Closes 'fd', ignoring any exceptions. Does nothing if 'fd' is null or invalid. */ public static void closeQuietly(FileDescriptor fd) { try { IoUtils.close(fd); } catch (IOException ignored) { } }
/** * Closes 'fd', ignoring any exceptions. Does nothing if 'fd' is null or invalid. */ public static void closeQuietly(FileDescriptor fd) { try { IoUtils.close(fd); } catch (IOException ignored) { } }
@Override public void close() throws IOException { try { super.close(); } finally { synchronized (this) { try { IoUtils.close(fd); } finally { fd = null; } } } } }
@Override public void close() throws IOException { try { super.close(); } finally { synchronized (this) { try { IoUtils.close(fd); } finally { fd = null; } } } } }
@Override public void close() throws IOException { try { super.close(); } finally { synchronized (this) { try { IoUtils.close(fd); } finally { fd = null; } } } } }
@Override protected void implCloseSelector() throws IOException { wakeup(); synchronized (this) { synchronized (unmodifiableKeys) { synchronized (selectedKeys) { IoUtils.close(wakeupIn); IoUtils.close(wakeupOut); doCancel(); for (SelectionKey sk : mutableKeys) { deregister((AbstractSelectionKey) sk); } } } } }
@Override protected void implCloseSelector() throws IOException { wakeup(); synchronized (this) { synchronized (unmodifiableKeys) { synchronized (selectedKeys) { IoUtils.close(wakeupIn); IoUtils.close(wakeupOut); doCancel(); for (SelectionKey sk : mutableKeys) { deregister((AbstractSelectionKey) sk); } } } } }