java.io

Class FileDescriptor

public final class FileDescriptor extends Object

This class represents an opaque file handle as a Java class. It should be used only to pass to other methods that expect an object of this type. No system specific information can be obtained from this object.

UNKNOWN: September 24, 1998

Field Summary
static FileDescriptorerr
A FileDescriptor representing the system standard error stream.
static FileDescriptorin
A FileDescriptor representing the system standard input stream.
static FileDescriptorout
A FileDescriptor representing the system standard output stream.
Constructor Summary
FileDescriptor()
This method is used to initialize an invalid FileDescriptor object.
Method Summary
voidsync()
This method forces all data that has not yet been physically written to the underlying storage medium associated with this FileDescriptor to be written out.
booleanvalid()
This methods tests whether or not this object represents a valid open native file handle.

Field Detail

err

public static final FileDescriptor err
A FileDescriptor representing the system standard error stream. This will usually be accessed through the System.errvariable.

in

public static final FileDescriptor in
A FileDescriptor representing the system standard input stream. This will usually be accessed through the System.invariable.

out

public static final FileDescriptor out
A FileDescriptor representing the system standard output stream. This will usually be accessed through the System.outvariable.

Constructor Detail

FileDescriptor

public FileDescriptor()
This method is used to initialize an invalid FileDescriptor object.

Method Detail

sync

public void sync()
This method forces all data that has not yet been physically written to the underlying storage medium associated with this FileDescriptor to be written out. This method will not return until all data has been fully written to the underlying device. If the device does not support this functionality or if an error occurs, then an exception will be thrown.

valid

public boolean valid()
This methods tests whether or not this object represents a valid open native file handle.

Returns: true if this object represents a valid native file handle, false otherwise