Here you can find the source of readFile(String fileName)
public static InputStream readFile(String fileName)
//package com.java2s; import java.io.FileNotFoundException; import java.io.InputStream; public class Main { public static InputStream readFile(String fileName) { InputStream result = null; try {/*from w ww .j a v a2s . c om*/ result = new java.io.FileInputStream(fileName); } catch (FileNotFoundException ex) { throw new IllegalArgumentException(ex); } if (result == null) { throw new IllegalArgumentException("Impossible to open the file."); } return result; } }