Java tutorial
//package com.java2s; import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; public class Main { public static InputStream readFile(File file) { try { InputStream in = new BufferedInputStream(new FileInputStream(file)); return in; } catch (Exception e) { e.printStackTrace(); } return null; } }