public enum RandomAccessFileMode extends Enum<RandomAccessFileMode>
RandomAccessFile.| Enum Constant and Description |
|---|
READ_ONLY
Mode
"r" opens for reading only. |
READ_WRITE
Mode
"rw" opens for reading and writing. |
READ_WRITE_SYNC_ALL
Mode
"rws" opens for reading and writing, as with "rw", and also require that every update to the file's content or metadata be written
synchronously to the underlying storage device. |
READ_WRITE_SYNC_CONTENT
Mode
"rwd" open for reading and writing, as with "rw", and also require that every update to the file's content be written synchronously
to the underlying storage device. |
| Modifier and Type | Method and Description |
|---|---|
RandomAccessFile |
create(File file)
Creates a random access file stream to read from, and optionally to write to, the file specified by the
File
argument. |
RandomAccessFile |
create(Path file)
Creates a random access file stream to read from, and optionally to write to, the file specified by the
File
argument. |
RandomAccessFile |
create(String file)
Creates a random access file stream to read from, and optionally to write to, the file specified by the
File
argument. |
String |
toString() |
static RandomAccessFileMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static RandomAccessFileMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final RandomAccessFileMode READ_ONLY
"r" opens for reading only.public static final RandomAccessFileMode READ_WRITE
"rw" opens for reading and writing.public static final RandomAccessFileMode READ_WRITE_SYNC_ALL
"rws" opens for reading and writing, as with "rw", and also require that every update to the file's content or metadata be written
synchronously to the underlying storage device.public static final RandomAccessFileMode READ_WRITE_SYNC_CONTENT
"rwd" open for reading and writing, as with "rw", and also require that every update to the file's content be written synchronously
to the underlying storage device.public static RandomAccessFileMode[] values()
for (RandomAccessFileMode c : RandomAccessFileMode.values()) System.out.println(c);
public static RandomAccessFileMode valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic RandomAccessFile create(File file) throws FileNotFoundException
File
argument.file - the file objectFileNotFoundException - See RandomAccessFile(File, String).public RandomAccessFile create(Path file) throws FileNotFoundException
File
argument.file - the file objectFileNotFoundException - See RandomAccessFile(File, String).public RandomAccessFile create(String file) throws FileNotFoundException
File
argument.file - the file objectFileNotFoundException - See RandomAccessFile(File, String).public String toString()
toString in class Enum<RandomAccessFileMode>Copyright © 2002–2023 The Apache Software Foundation. All rights reserved.