Android
java.io
public final class

java.io.FileDescriptor

java.lang.Object
java.io.FileDescriptor

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.

Summary

Constants

      Value  
FileDescriptor  err  FileDescriptor representing Standard Error      
FileDescriptor  in  FileDescriptor representing Standard In      
FileDescriptor  out  FileDescriptor representing Standard Out      

Public Constructors

            FileDescriptor()
Constructs a new FileDescriptor containing an invalid handle.

Public Methods

          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

Details

Constants

public static final FileDescriptor err

FileDescriptor representing Standard Error

public static final FileDescriptor in

FileDescriptor representing Standard In

public static final FileDescriptor out

FileDescriptor representing Standard Out

Public Constructors

public FileDescriptor()

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

Public Methods

public void sync()

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

public boolean valid()

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

Returns

  • true if this FileDescriptor is valid, false otherwise
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56