@Override @SuppressWarnings("unchecked") public void completed(int bytesTransferred,boolean canInvokeDirect){
  updateBuffers(bytesTransferred);
  releaseBuffers();
synchronized (result) {
    if (result.isDone())     return;
    enableWriting();
    if (gatheringWrite) {
      result.setResult((V)Long.valueOf(bytesTransferred));
    }
 else {
      result.setResult((V)Integer.valueOf(bytesTransferred));
    }
  }
  if (canInvokeDirect) {
    Invoker.invokeUnchecked(result);
  }
 else {
    Invoker.invoke(result);
  }
}

@ Override @ SuppressWarnings ( "unchecked" ) public void completed ( int bytesTransferred , boolean canInvokeDirect ) { updateBuffers ( bytesTransferred ) ; releaseBuffers ( ) ; synchronized ( result ) { if ( result . isDone ( ) ) return ; enableWriting ( ) ; if ( gatheringWrite ) { result . setResult ( ( V ) Long . valueOf ( bytesTransferred ) ) ; } else { result . setResult ( ( V ) Integer . valueOf ( bytesTransferred ) ) ; } } if ( canInvokeDirect ) { Invoker . invokeUnchecked ( result ) ; } else { Invoker . invoke ( result ) ; } }
executed when the i / o has completed
