Is the following method provided by Java NIO thread safe?
public static Path write(Path path,
Iterable<? extends CharSequence> lines,
Charset cs,
OpenOption... options)
throws IOException
The API doesn't say anything about the thread safe but inside the method implementation it uses a output stream that is thread as per the documentation. Also I have noticed that the method it invokes Writer.java-> write(String str, int off, int len) is having synchronized block.
There are some post related file writing API, but those are not using the NIO Files.write method.
Anyone can confirm whether the method is safe to be called from multiple threads?