RandomAccessFile.Seek(Int64) Method

Definition

Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs.

[Android.Runtime.Register("seek", "(J)V", "GetSeek_JHandler")]
public virtual void Seek (long pos);
[<Android.Runtime.Register("seek", "(J)V", "GetSeek_JHandler")>]
abstract member Seek : int64 -> unit
override this.Seek : int64 -> unit

Parameters

pos
Int64

the offset position, measured in bytes from the beginning of the file, at which to set the file pointer.

Attributes

Exceptions

if this file is closed, pos or another I/O error occurs.

Remarks

Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs. The offset may be set beyond the end of the file. Setting the offset beyond the end of the file does not change the file length. The file length will change only by writing after the offset has been set beyond the end of the file.

Java documentation for java.io.RandomAccessFile.seek(long).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to