Java FileWriter(FileDescriptor fd) Constructor

Syntax

FileWriter(FileDescriptor fd) constructor from FileWriter has the following syntax.

public FileWriter(FileDescriptor fd)

Example

In the following code shows how to use FileWriter.FileWriter(FileDescriptor fd) constructor.


// www  . j ava 2s  .co m
import java.io.FileOutputStream;
import java.io.FileWriter;

public class Main {
  public static void main(String[] args) throws Exception {
    FileWriter fileWriter = new FileWriter(new FileOutputStream("c:/abc.txt").getFD());
    fileWriter.append("java2s.com");
    fileWriter.close();
    
  }
}