new FileInputStream(File file) : FileInputStream « java.io « Java by API






new FileInputStream(File file)

 
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class Main {
  public static void main(String[] a) {
    File aFile = new File("C:/myFile.txt");
    FileInputStream inputFile = null;
    try {
      inputFile = new FileInputStream(aFile);
    } catch (FileNotFoundException e) {
      e.printStackTrace(System.err);
      System.exit(1);
    }
  }
}

   
  








Related examples in the same category

1.new FileInputStream(FileDescriptor fdObj)
2.new FileInputStream(String name)
3.FileInputStream: available()
4.FileInputStream: close()
5.FileInputStream: getChannel()
6.FileInputStream: getFD()
7.FileInputStream: read()