我正在尝试通读在线存储的文件,但该文件没有类型标记。我的代码怎么了,我需要改变什么?
代码:
public void Button1Click (View view) throws ClientProtocolException, IOException {
int countWords = 0;
FileInputStream fstream = new FileInputStream("http://textfile/textfile");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String line = "";
while ((line = br.readLine()) != null) {
}
in.close();
}
当我运行代码时,它说“不幸的是,测试已停止”