Enum Class FileMode

java.lang.Object
java.lang.Enum<FileMode>
org.miaixz.bus.core.io.file.FileMode
All Implemented Interfaces:
Serializable, Comparable<FileMode>, Constable

public enum FileMode extends Enum<FileMode>
文件读写模式,常用于RandomAccessFile
Since:
Java 17+
Author:
Kimi Liu
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    以只读方式打开。调用结果对象的任何 write 方法都将导致抛出 IOException。
    打开以便读取和写入。
    打开以便读取和写入,相对于 "rw","rwd" 还要求对“文件的内容”的每个更新都同步写入到基础存储设备。
    打开以便读取和写入。相对于 "rw","rws" 还要求对“文件的内容”或“元数据”的每个更新都同步写入到基础存储设备。
  • Method Summary

    Modifier and Type
    Method
    Description
    static FileMode
    Returns the enum constant of this class with the specified name.
    static FileMode[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • r

      public static final FileMode r
      以只读方式打开。调用结果对象的任何 write 方法都将导致抛出 IOException。
    • rw

      public static final FileMode rw
      打开以便读取和写入。
    • rws

      public static final FileMode rws
      打开以便读取和写入。相对于 "rw","rws" 还要求对“文件的内容”或“元数据”的每个更新都同步写入到基础存储设备。
    • rwd

      public static final FileMode rwd
      打开以便读取和写入,相对于 "rw","rwd" 还要求对“文件的内容”的每个更新都同步写入到基础存储设备。
  • Method Details

    • values

      public static FileMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static FileMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null