- public static String readAssert(Context context, String fileName){
- String resultString="";
- try {
- InputStream inputStream=context.getResources().getAssets().open(fileName);
- byte[] buffer=new byte[inputStream.available()];
- inputStream.read(buffer);
- resultString=new String(buffer,"utf-8");
- } catch (Exception e) {
- e.printStackTrace();
- }
- return resultString;
- }
读取android assets 文件 方法
最新推荐文章于 2023-04-27 21:50:21 发布