public final class FileDescriptor extends Object
FileInputStream or FileOutputStream to contain it. Applications should not create their own file descriptors.
| Modifier and Type | Field | Description |
|---|---|---|
static final FileDescriptor |
err |
A handle to the standard error stream. |
static final FileDescriptor |
in |
A handle to the standard input stream. |
static final FileDescriptor |
out |
A handle to the standard output stream. |
| Constructor | Description |
|---|---|
FileDescriptor() |
Constructs an (invalid) FileDescriptor object. |
public static final FileDescriptor in
System.in.public static final FileDescriptor out
System.out.public static final FileDescriptor err
System.err.public FileDescriptor()
public boolean valid()
true if the file descriptor object represents a valid, open file, socket, or other active I/O connection; false otherwise.public void sync() throws SyncFailedException
SyncFailedException - Thrown when the buffers cannot be flushed, or because the system cannot guarantee that all the buffers have been synchronized with physical media.
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/io/FileDescriptor.html