As pointed out on the nio-dev list:
http://mail.openjdk.java.net/pipermail/nio-dev/2012-October/001936.html
the FileChannel.truncate method doesn't throw any exception when invoked on a file opened for read only and size > size().
In addition the position isn't changed when truncate is invoked for a size larger than the current size.
http://mail.openjdk.java.net/pipermail/nio-dev/2012-October/001936.html
the FileChannel.truncate method doesn't throw any exception when invoked on a file opened for read only and size > size().
In addition the position isn't changed when truncate is invoked for a size larger than the current size.