Java.IO.RandomAccessFile.SetLength Method
Sets the length of this file to newLength.

Syntax

[Android.Runtime.Register("setLength", "(J)V", "GetSetLength_JHandler")]
public virtual void SetLength (long newLength)

Parameters

newLength
the new file length in bytes.

Exceptions

TypeReason
Java.Lang.IllegalArgumentExceptionif newLength .
Java.IO.IOExceptionif this file is closed or another I/O error occurs.

Remarks

Sets the length of this file to newLength. If the current file is smaller, it is expanded but the contents from the previous end of the file to the new end are undefined. The file is truncated if its current size is bigger than newLength. If the current file pointer position is in the truncated part, it is set to the end of the file.

[Android Documentation]

Requirements

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