Android - Store inputstream in file

前端 未结 7 2059
[愿得一人]
[愿得一人] 2020-12-02 11:56

I am retrieveing an XML feed from a url and then parsing it. What I need to do is also store that internally to the phone so that when there is no internet connection it can

7条回答
  •  鱼传尺愫
    2020-12-02 12:35

    A shorter version:

    OutputStream out = new FileOutputStream(file);
    fos.write(IOUtils.read(in));
    out.close();
    in.close();
    

提交回复
热议问题