Java.Nio.Channels.FileChannel.Position Method
Sets the file position pointer to a new value.

Syntax

[Android.Runtime.Register("position", "(J)Ljava/nio/channels/FileChannel;", "GetPosition_JHandler")]
public abstract FileChannel Position (long offset)

Parameters

newPosition
the new file position, in bytes.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Lang.IllegalArgumentExceptionif the new position is negative.
Java.Nio.Channels.ClosedChannelExceptionif this channel is closed.
Java.IO.IOExceptionif another I/O error occurs.

Remarks

Sets the file position pointer to a new value.

The argument is the number of bytes counted from the start of the file. The position cannot be set to a value that is negative. The new position can be set beyond the current file size. If set beyond the current file size, attempts to read will return end of file. Write operations will succeed but they will fill the bytes between the current end of file and the new position with the required number of (unspecified) byte values.

[Android Documentation]

Requirements

Namespace: Java.Nio.Channels
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1