private void removeInterest ( SelectableChannel channel , int operation ) { SelectionKey key = channel . keyFor ( selector ) ; // Exception would be thrown if key is null or key is inValid // We do not need double check it ahead key . interestOps ( key . interestOps ( ) & ( ~ operation ) ) ; }
Remove one operation interest on a SelectableChannel . The SelectableChannel has to be registered with Selector ahead . Otherwise NullPointerExceptions would throw The key for SelectableChannel has to be valid . Otherwise InvalidValid Exception would throw .