Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public final class

FileDescriptor

extends Object
java.lang.Object
   ↳ java.io.FileDescriptor

Class Overview

Wraps a Unix file descriptor. It's possible to get the file descriptor used by some classes (such as FileInputStream , FileOutputStream , and RandomAccessFile ), and then create new streams that point to the same file descriptor.

Summary

Fields
public static final FileDescriptor err Corresponds to stderr .
public static final FileDescriptor in Corresponds to stdin .
public static final FileDescriptor out Corresponds to stdout .
Public Constructors
FileDescriptor ()
Constructs a new invalid FileDescriptor.
Public Methods
void sync ()
Ensures that data which is buffered within the underlying implementation is written out to the appropriate device before returning.
String toString ()
Returns a string containing a concise, human-readable description of this object.
boolean valid ()
Tests whether this FileDescriptor is valid.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public static final FileDescriptor err

Added in API level 1

Corresponds to stderr .

public static final FileDescriptor in

Added in API level 1

Corresponds to stdin .

public static final FileDescriptor out

Added in API level 1

Corresponds to stdout .

Public Constructors

public FileDescriptor ()

Added in API level 1

Constructs a new invalid FileDescriptor.

Public Methods

public void sync ()

Added in API level 1

Ensures that data which is buffered within the underlying implementation is written out to the appropriate device before returning.

public String toString ()

Added in API level 1

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

          getClass().getName() + '@' + Integer.toHexString(hashCode())
         

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • a printable representation of this object.

public boolean valid ()

Added in API level 1

Tests whether this FileDescriptor is valid.