List of usage examples for java.nio.channels.spi AbstractInterruptibleChannel close
public final void close() throws IOException
From source file:dk.clanie.io.IOUtil.java
/** * Closes nio Channels.//from ww w. j ava2s . c om * <p> * Suppresses errors - if an Exception occurs it will be logged, but * otherwise silently ignored. * </p> * <p> * Nulls in the channels argument are ignored. * </p> * * @param channels * - AbstractInterruptibleChannels to close. */ public static void closeChannels(AbstractInterruptibleChannel... channels) { for (AbstractInterruptibleChannel channel : channels) { if (channel == null) continue; try { channel.close(); } catch (Exception e) { log.error(FAILED_TO_CLOSE_CHANNEL, e); } } }