code: public long getByteCount(long timeout) throws InterruptedException, IOException {
          waitForCompletion(timeout);
          if (this.exception != null) {
              throwException();
          }
          return this.byteCount;
      }
docs: Returns the number of bytes read/written in the operation, or zero
  if none. If the future is completed, the call returns immediately,
  otherwise the call blocks for at least the given number of
  milliseconds. If the call has not completed within the timeout
  period an <code>AsyncTimeoutException</code> is thrown.
  
  @param timeout
  the maximum time to wait in milliseconds.
  Specifying 0L means wait forever.
  @return The number of bytes read/written in this operation.
  @throws InterruptedException
  if the calling thread was interrupted during
  it's wait for the operation to complete.
  @throws AsyncTimeoutException
  if the call did not complete within the given
  timeout period.
  @throws IOException
  if the operation failed
  @throws ClosedChannelException
  if the channel was closed for IO when the
  operation was attempted