java.io
Class FileDescriptor

java.lang.Object
  extended by java.io.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.


Field Summary
static FileDescriptor err
          A FileDescriptor representing the system standard error stream.
static FileDescriptor in
          A FileDescriptor representing the system standard input stream.
static FileDescriptor out
          A FileDescriptor representing the system standard output stream.
 
Constructor Summary
FileDescriptor()
          This method is used to initialize an invalid FileDescriptor object.
 
Method Summary
 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.
 boolean valid()
          This methods tests whether or not this object represents a valid open native file handle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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.


err

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

Constructor Detail

FileDescriptor

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

Method Detail

sync

public void sync()
          throws SyncFailedException
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.

Throws:
SyncFailedException

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