Wednesday, January 18, 2017

Java.io.FileDescriptor Class

Introduction

The Java.io.FileDescriptor class instances serve as an opaque handle to the underlying machine-specific structure representing an open file, an open socket, or another source or sink of bytes. Following are the important points about FileDescriptor:

  • The main practical use for a file descriptor is to create a FileInputStream or FileOutputStream to contain it.
  • Applications should not create their own file descriptors.

Class declaration

Following is the declaration for Java.io.FileDescriptor class:
public final class FileDescriptor
   extends Object

Field

Following are the fields for Java.io.FileDescriptor class:
  • static FileDescriptor err -- This is the handle to the standard error stream.
  • static FileDescriptor in -- This is the handle to the standard input stream.
  • static FileDescriptor out -- This is the handle to the standard output stream.

Class constructors

S.N. Constructor & Description
1 FileDescriptor()
This method constructs an (invalid) FileDescriptor object.

Class methods

S.N. Method & Description
1 void sync()
This method force all system buffers to synchronize with the underlying device.
2 boolean valid()
This method tests if this file descriptor object is valid.

Methods inherited

This class inherits methods from the following classes:
  • Java.io.Object

No comments:

Post a Comment