Java IO Tutorial - 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.

/*from   w  w w .j  a  v a  2s . c o 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();
    
  }
}