Javatpoint Logo
Javatpoint Logo

Java FileDescriptor

FileDescriptor class serves as an handle to the underlying machine-specific structure representing an open file, an open socket, or another source or sink of bytes. The handle can be err, in or out.

The FileDescriptor class is used to create a FileInputStream or FileOutputStream to contain it.


Modifier Type Field Description
static FileDescriptor err A handle to the standard error stream.
static FileDescriptor in A handle to the standard input stream.
static FileDescriptor out A handle to the standard output stream.


Constructor Description
FileDescriptor() Constructs an (invalid) FileDescriptor object.


Modifier and Type Method Description
void sync() It force all system buffers to synchronize with the underlying device.
boolean valid() It tests if this file descriptor object is valid.

Java FileDescriptor Example


Sync() successfully executed!!



Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA