position
Returns this channel's position.
Return
This channel's position, a non-negative integer counting the number of bytes from the beginning of the entity to the current position
Throws
If this channel is closed
If some other I/O error occurs
Sets this channel's position.
Setting the position to a value that is greater than the current size is legal but does not change the size of the entity. A later attempt to read bytes at such a position will immediately return an end-of-file indication. A later attempt to write bytes at such a position will cause the entity to grow to accommodate the new bytes; the values of any bytes between the previous end-of-file and the newly-written bytes are unspecified.
Setting the channel's position is not recommended when connected to an entity, typically a file, that is opened with the APPEND option. When opened for append, the position is first advanced to the end before writing.
Return
This channel
Parameters
The new position, a non-negative integer counting the number of bytes from the beginning of the entity
Throws
If this channel is closed
If the new position is negative
If some other I/O error occurs