加载中...
The Wayback Machine - https://sup1a9wrlpyh5li9ro.vcoronado.top/web/20090406034855/http://developer.android.com:80/reference/java/io/FileDescriptor.html
public final class

FileDescriptor

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

Class Overview

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
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.
[Expand]
Inherited Methods
From class java.lang.Object

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