Truncates the file underlying this channel to a given size.
Any bytes beyond the given size are removed from the file. If there are no bytes beyond the given size then the file contents are unmodified.
If the file position is currently greater than the given size, then it is set to be the given size.
@param size the maximum size of the underlying file
@throws IllegalArgumentException the requested size is negative.
@throws ClosedChannelException the channel is closed.
@throws NonWritableChannelException the channel cannot be written.
@throws IOException some other IO problem occured.
@return this channel