Here you can find the source of readFileSdcard(File file)
public static String readFileSdcard(File file) throws Exception
//package com.java2s; import java.io.File; import java.io.FileInputStream; import org.apache.http.util.EncodingUtils; public class Main { public static String readFileSdcard(File file) throws Exception { String res = ""; FileInputStream fin = new FileInputStream(file); int length = fin.available(); byte[] buffer = new byte[length]; fin.read(buffer);/*from w w w . j ava 2 s .c o m*/ res = EncodingUtils.getString(buffer, "UTF-8"); fin.close(); return res; } }