Is it safe to write from different threads to one file using FileChannel.position()
? This is necessary for multipart downloading. Each thread will write to its position in the file, i.e. the positions of the thread will not intersect.
While the individual option is thread safe, it's not thread local and changing it will be visible to all threads.
The simplest option is to create a FileChannel for each thread which avoid any interactions unless you write to the file in which case those changes can be seen.