blogspot.com-GA4

星期三, 12月 23, 2009

InputStream 轉出 String

把InputStream內的 Strung 串流轉出

InputStream is = blob.getBinaryStream();
if (is != null) {
String line;
BufferedReader reader = new BufferedReader(new InputStreamReader(is, "Big5"));
while ((line = reader.readLine()) != null) {
sb.append(line).append("\n");
}
}

System.out.println(sb.toString());

沒有留言: