ERROR - java.nio.NonWritableChannelException - Possible Causes of NonWritableChannelException

Exception Thrown By:Cause
ClassMethod
AsynchronousFileChannel public abstract AsynchronousFileChannel
truncate(long size)
If this channel
was not opened for writing.
FileChannel public abstract FileChannel
truncate(long size)
If this channel
was not opened for writing.