0

I have 2 questions

  1. How will AsynchronousFileChannel work if my operating system does not support AIO (lower then linux 2.6 etc).

  2. How to append sth into AsynchronousFileChannel, as far as I know AsynchronousFileChannel only supports write(ByteBuffer, long position, A attachment, CompletionHandler handler) and write(ByteBuffer src, long position) both need a position param. Should I count the position myself?

Alexis
  • 1,080
  • 3
  • 21
  • 44

1 Answers1

1

Question 2: From the javadoc

An asynchronous file channel does not have a current position within the file. Instead, the file position is specified to each read and write method that initiates asynchronous operations.

So yes, you need to keep track of the position yourself.

Kayaman
  • 72,141
  • 5
  • 83
  • 121