FileChannel.MapMode

  • FileChannel.MapMode is a typesafe enumeration used for defining file-mapping modes.

  • It provides three modes: PRIVATE (copy-on-write), READ_ONLY, and READ_WRITE for controlling access to mapped file regions.

  • These modes are used when mapping a file region into memory using FileChannel.map().

  • Each mode has a specific behavior regarding data modification and synchronization with the underlying file.

  • The toString() method provides a descriptive string representation of the mapping mode.

public static class FileChannel.MapMode extends Object

A typesafe enumeration for file-mapping modes.

Field Summary

public static final FileChannel.MapMode PRIVATE Mode for a private (copy-on-write) mapping.
public static final FileChannel.MapMode READ_ONLY Mode for a read-only mapping.
public static final FileChannel.MapMode READ_WRITE Mode for a read/write mapping.

Public Method Summary

String
toString()
Returns a string describing this file-mapping mode.

Inherited Method Summary

Fields

public static final FileChannel.MapMode PRIVATE

Mode for a private (copy-on-write) mapping.

public static final FileChannel.MapMode READ_ONLY

Mode for a read-only mapping.

public static final FileChannel.MapMode READ_WRITE

Mode for a read/write mapping.

Public Methods

public String toString ()

Returns a string describing this file-mapping mode.

Returns
  • A descriptive string