Create DataOutputStream from FileOutputStream - Java File Path IO

Java examples for File Path IO:FileOutputStream

Description

Create DataOutputStream from FileOutputStream

Demo Code


import java.io.DataOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
 
public class Main {
 
  public static void main(String[] args) {
   //from   www . j av  a 2  s.c o  m
    String strFilePath = "C://Folder//demo.txt";
   
    try {
      FileOutputStream fos = new FileOutputStream(strFilePath);
      DataOutputStream dos = new DataOutputStream(fos);
    }
    catch(FileNotFoundException fe)
    {
      System.out.println("FileNotFoundException : " + fe);
    }
 
  }
}

Related Tutorials