Java tutorial
//package com.java2s; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; public class Main { public static String readTextFromSDcard(InputStream is) throws Exception { InputStreamReader reader = new InputStreamReader(is); BufferedReader bufferedReader = new BufferedReader(reader); StringBuffer buffer = new StringBuffer(""); String str; while ((str = bufferedReader.readLine()) != null) { buffer.append(str); buffer.append("\n"); } return buffer.toString(); } }