您的位置:首页 > 编程语言 > Java开发

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

2011-03-31 10:53 423 查看
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]);
  }
  
 }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  java string byte