将InputStream转换为String
import java.io.BufferedReader;/** 来自 时 代 J a v a - nowjava.com**/ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Scanner; public class Main { public static void main(String args[]) throws IOException{ InputStream is = new FileInputStream("c:/data.txt"); String strContent; //Create BufferedReader object BufferedReader bReader = new BufferedReader(new InputStreamReader(is)); /* 来 自* nowjava.com - 时代Java */ StringBuffer sbfFileContents = new StringBuffer(); String line = null; //read file line by line while( (line = bReader