首页 > 编程语言 > 详细

java 读取xml文件开头多了一个问号

时间:2014-09-26 19:17:20      阅读:573      评论:0      收藏:0      [点我收藏+]
File file = new File("D:/xml/PD20140924154_cunchu.xml");

  StringBuilder sb = new StringBuilder();

  FileInputStream fis=null;

  BufferedReader bf=null;

  try {

   fis = new FileInputStream(file);

   bf = new BufferedReader(new InputStreamReader(fis,"utf-8"));

   String str="";

   while((str=bf.readLine())!=null){

    sb.append(str);

   }

  } catch (FileNotFoundException e) {

   e.printStackTrace();

  } catch (IOException e) {

   e.printStackTrace();

  }

  

  System.out.println(sb.toString());

  System.out.println("===============================================");

  System.out.println(sb.toString().replaceAll("##", ">").replaceAll("
\\$\\$
", "<"));

 

?<?xml version="1.0" encoding="utf-8" ?><Assets InventoryNumber="PD20140924154" TaskName="" BatchName="">

 

java 读取xml文件开头多了一个问号

原文:http://yjm199.blog.51cto.com/4408395/1558516

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!