读取dat文件

时间:2025-02-24 07:01:31
/**
* 读取assest下的dat文件
* */
private static String readPromoter(Activity activity) {
String fileName = ""; //文件名字
String res="";
try{


//得到资源中的asset数据流
InputStream in = ().getAssets().open(fileName);
int length = ();
byte [] buffer = new byte[length];
(buffer);
();
res=new String(buffer ,"UTF-8");
("分销人员id", res);
dat=res;
}catch(Exception e){
();
}
return res;
}