Dela via


MappedByteBuffer.Force Method

Definition

Forces any changes made to this buffer's content to be written to the storage device containing the mapped file.

[Android.Runtime.Register("force", "()Ljava/nio/MappedByteBuffer;", "")]
public Java.Nio.MappedByteBuffer? Force ();
[<Android.Runtime.Register("force", "()Ljava/nio/MappedByteBuffer;", "")>]
member this.Force : unit -> Java.Nio.MappedByteBuffer

Returns

This buffer

Attributes

Remarks

Forces any changes made to this buffer's content to be written to the storage device containing the mapped file.

If the file mapped into this buffer resides on a local storage device then when this method returns it is guaranteed that all changes made to the buffer since it was created, or since this method was last invoked, will have been written to that device.

If the file does not reside on a local device then no such guarantee is made.

If this buffer was not mapped in read/write mode (java.nio.channels.FileChannel.MapMode#READ_WRITE) then invoking this method has no effect.

Java documentation for java.nio.MappedByteBuffer.force().

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