Skip to content

Most visited

Recently visited

navigation
Added in API level 1

FileDescriptor

public final class FileDescriptor
extends Object

java.lang.Object
   ↳ java.io.FileDescriptor


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.

Inherited methods

From class java.lang.Object

Fields

err

Added in API level 1
FileDescriptor err

Corresponds to stderr.

in

Added in API level 1
FileDescriptor in

Corresponds to stdin.

out

Added in API level 1
FileDescriptor out

Corresponds to stdout.

Public constructors

FileDescriptor

Added in API level 1
FileDescriptor ()

Constructs a new invalid FileDescriptor.

Public methods

sync

Added in API level 1
void sync ()

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

Throws
SyncFailedException

toString

Added in API level 1
String toString ()

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
String a printable representation of this object.

valid

Added in API level 1
boolean valid ()

Tests whether this FileDescriptor is valid.

Returns
boolean
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.