Android,试图通读在线存储的文件。但文件没有类型标签

时间:2014-02-17 20:13:08

标签: java android fileinputstream datainputstream

我正在尝试通读在线存储的文件,但该文件没有类型标记。我的代码怎么了,我需要改变什么?

代码:

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();
}

当我运行代码时,它说“不幸的是,测试已停止”

0 个答案:

没有答案