private void read(final AsynchronousFileChannel channel) throws IllegalArgumentException, NonReadableChannelException, CancellationException, InterruptedException {
  if (isDone()) {
    try {
      m_fut.get();
    }
 catch (    ExecutionException ex) {
      m_fut=null;
    }
  }
  if (!isDone()) {
    m_buffer.reset();
    m_fut=channel.read(m_buffer,m_addr);
  }
}

private void read ( final AsynchronousFileChannel channel ) throws IllegalArgumentException , NonReadableChannelException , CancellationException , InterruptedException { if ( isDone ( ) ) { try { m_fut . get ( ) ; } catch ( ExecutionException ex ) { m_fut = null ; } } if ( ! isDone ( ) ) { m_buffer . reset ( ) ; m_fut = channel . read ( m_buffer , m_addr ) ; } }
schedule a read on the channel . if the operation was previously schedule and is done ( normal completion ) , then return immediately . if the operation was previously schedule and was cancelled , then throws out a cancellationexception . if the operation was previously schedule and failed , then the future is cleared and the operation is rescheduled . this is done in order to allow us to complete a high level read on the channel when the backing channel may have been closed by an interrupt in another thread due to java io channel semantics ( e . g . , driven by query termination during reads ) .
