Java tutorial
//package com.java2s; //License from project: Apache License import android.util.Log; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; public class Main { final static String TAG = "OTUtils.otclient"; public static InputStream fileToInputStream(String fileName) throws FileNotFoundException { File file = new File(fileName); if (!file.exists()) { Log.e(TAG, fileName + " not found."); return null; } return new FileInputStream(file); } }