public enum RandomAccessFileMode extends java.lang.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 |
---|---|
java.io.RandomAccessFile |
create(java.io.File file)
Creates a random access file stream to read from, and optionally to write to, the file specified by the
File
argument. |
java.io.RandomAccessFile |
create(java.nio.file.Path file)
Creates a random access file stream to read from, and optionally to write to, the file specified by the
File
argument. |
java.io.RandomAccessFile |
create(java.lang.String file)
Creates a random access file stream to read from, and optionally to write to, the file specified by the
File
argument. |
java.lang.String |
toString() |
static RandomAccessFileMode |
valueOf(java.lang.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(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic java.io.RandomAccessFile create(java.io.File file) throws java.io.FileNotFoundException
File
argument.file
- the file objectjava.io.FileNotFoundException
- See RandomAccessFile(File, String)
.public java.io.RandomAccessFile create(java.nio.file.Path file) throws java.io.FileNotFoundException
File
argument.file
- the file objectjava.io.FileNotFoundException
- See RandomAccessFile(File, String)
.public java.io.RandomAccessFile create(java.lang.String file) throws java.io.FileNotFoundException
File
argument.file
- the file objectjava.io.FileNotFoundException
- See RandomAccessFile(File, String)
.public java.lang.String toString()
toString
in class java.lang.Enum<RandomAccessFileMode>
Copyright © 2010 - 2023 Adobe. All Rights Reserved