`
ynztpwl
  • 浏览: 55841 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

java读取资源文件--使用文件流的方式读取

 
阅读更多

public static void main(String[] args) throws FileNotFoundException, IOException {
InputStream is=new FileInputStream("resource.properties");
byte[] b=new byte[is.available()];s
while(is.read(b)!=-1){
//System.out.print(new String(b,"utf-8"));
}
String str=new String(b,"utf-8");
String[] strs=str.split(" ");
for(int i=0;i<strs.length;i++){
System.out.println(strs[i]);
}

}

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics