• 读取Assets中的文件数据


     1 try {
     2             // 返回的字节流
     3             InputStream is = getResources().getAssets().open("info.txt");
     4             // 当读取时,属于文本文件的时候,需要将它包装成字符流。
     5             InputStreamReader isr = new InputStreamReader(is, "UTF-8");
     6             // 进一步进行包装
     7             BufferedReader bfr = new BufferedReader(isr);
     8             String in = "";
     9             while ((in = bfr.readLine()) != null) {
    10                 Log.i("AAA", in);                
    11             }
    12         } catch (IOException e) {
    13             e.printStackTrace();
    14         }
  • 相关阅读:
    SCUT
    模板
    重链剖分
    树的重心
    SCUT
    SCUT
    SCUT
    SCUT
    SCUT
    SCUT
  • 原文地址:https://www.cnblogs.com/androidsj/p/3910343.html
Copyright © 2020-2023  润新知