FileDescriptor

Instances of the file descriptor class serve as an opaque handle to the underlying machine-specific structure representing an open file, an open socket, or another source or sink of bytes. The main practical use for a file descriptor is to create a {@link FileInputStream} or {@link FileOutputStream} to contain it.

<p>Applications should not create their own file descriptors.

@author Pavani Diwanji

Constructors

this
this()

Constructs an (invalid) FileDescriptor object.

Members

Functions

attach
void attach(Closeable c)

Attach a Closeable to this FD for tracking. parent reference is added to otherParents when needed to make closeAll simpler.

closeAll
void closeAll(Closeable releaser)

Cycle through all Closeables sharing this FD and call close() on each one.

sync
void sync()

Force all system buffers to synchronize with the underlying device. This method returns after all modified data and attributes of this FileDescriptor have been written to the relevant device(s). In particular, if this FileDescriptor refers to a physical storage medium, such as a file in a file system, sync will not return until all in-memory modified copies of buffers associated with this FileDesecriptor have been written to the physical medium.

valid
bool valid()

Tests if this file descriptor object is valid.

Meta