Contents | Prev | Next | Index

22.26 The Class java.io.FileDescriptor

A FileDescriptor is an opaque representation of a connection to an actual file in a file system, or to a network socket, or to another source or sink of bytes. The main practical use for a file descriptor is to create a FileInputStream (§22.4.3) or FileOutputStream (§22.16.3) to contain it.

public final class FileDescriptor {

	public static final FileDescriptor in = ...;

	public static final FileDescriptor out = ...;

	public static final FileDescriptor err = ...;

	public boolean valid();

}

22.26.1 public static final FileDescriptor in = ...

A file descriptor for the standard input stream. Usually, this file descriptor is not used directly, but rather the input stream known as System.in (§20.18.1).

22.26.2 public static final FileDescriptor out = ...

A file descriptor for the standard output stream. Usually, this file descriptor is not used directly, but rather the output stream known as System.out (§20.18.2).

22.26.3 public static final FileDescriptor err = ...

A file descriptor for the standard error output stream. Usually, this file descriptor is not used directly, but rather the output stream known as System.err (§20.18.3).

22.26.4 public boolean valid()

If this FileDescriptor is valid (represents an active connection to a file or other active I/O connection), then the result is true. Otherwise, the result is false.


Contents | Prev | Next | Index

Java Language Specification (HTML generated by Suzette Pelouch on February 24, 1998)
Copyright © 1996 Sun Microsystems, Inc. All rights reserved
Please send any comments or corrections to doug.kramer@sun.com


Banner.Novgorod.Ru