Build 1.0_r1(from source)

java.io
Class FileDescriptor

java.lang.Object
  extended by java.io.FileDescriptor

public final class FileDescriptor
extends Object

FileDescriptor is the lowest level representation of a File, Device, or Socket. You can create any of the IO classes which take a FileDescriptor as an argument by querying an open Socket or File for the FileDescriptor.

The FileDescriptor class also contains static fields representing Standard Input, Output and Error. You can use these directly if desired but it is recommended you go through System.in, System.out, and System.err streams respectively.

Applications should not create new FileDescriptors.

See Also:
FileInputStream.getFD(), FileOutputStream.getFD(), RandomAccessFile.getFD()

Field Summary
(package private)  int descriptor
          Represents a link to any underlying OS resources for this FileDescriptor.
static FileDescriptor err
          FileDescriptor representing Standard Error
static FileDescriptor in
          FileDescriptor representing Standard In
static FileDescriptor out
          FileDescriptor representing Standard Out
(package private)  boolean readOnly
           
 
Constructor Summary
FileDescriptor()
          Constructs a new FileDescriptor containing an invalid handle.
 
Method Summary
 void sync()
          Ensures that data which is buffered within the underlying implementation is written out to the appropriate device before returning.
 boolean valid()
          Returns a boolean indicating whether or not this FileDescriptor is valid.
 
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
FileDescriptor representing Standard In


out

public static final FileDescriptor out
FileDescriptor representing Standard Out


err

public static final FileDescriptor err
FileDescriptor representing Standard Error


descriptor

int descriptor
Represents a link to any underlying OS resources for this FileDescriptor. A value of -1 indicates that this FileDescriptor is invalid.


readOnly

boolean readOnly
Constructor Detail

FileDescriptor

public FileDescriptor()
Constructs a new FileDescriptor containing an invalid handle. This constructor does nothing interesting. Provided for signature compatibility.

Method Detail

sync

public void sync()
          throws SyncFailedException
Ensures that data which is buffered within the underlying implementation is written out to the appropriate device before returning.

Throws:
SyncFailedException - when the operation fails

valid

public boolean valid()
Returns a boolean indicating whether or not this FileDescriptor is valid.

Returns:
true if this FileDescriptor is valid, false otherwise

Build 1.0_r1(from source)

Please submit a feedback, bug or feature