Here you can find the source of readFileAsInputStream(File file)
Parameter | Description |
---|---|
file | the file to read |
public static FileInputStream readFileAsInputStream(File file)
//package com.java2s; //License from project: LGPL import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; public class Main { /**// w ww .ja v a2s. c o m * Read a file as FileInputStream. * * @param fileName * the file name to read * @return the file as FileInputStream, or null if the file is not found. */ public static FileInputStream readFileAsInputStream(String fileName) { try { return new FileInputStream(fileName); } catch (FileNotFoundException e) { return null; } } /** * Read a file as FileInputStream. * * @param file * the file to read * @return the file as FileInputStream, or null if the file is not found. */ public static FileInputStream readFileAsInputStream(File file) { try { return new FileInputStream(file); } catch (FileNotFoundException e) { return null; } } }