Future<Void> result = Util.finishedFuture(null);
key.runCompletion(handler, attachment, result);
return AttachedFuture.wrap(result, attachment);
}
} catch (ClosedChannelException e) {
throw Util.initCause(new ClosedAsynchronousChannelException(), e);
} catch (IOException e) {
Future<Void> result = Util.failedFuture(e);
key.runCompletion(handler, attachment, result);
return AttachedFuture.wrap(result, attachment);
}