在java中apache提供了一个工具类BOMStream,在获取文件流时,将获取到的文件流转化成为BOM流: InputStreamReader is = new InputStreamReader (new BOMInputStream (fileInputStream), "utf8"); 这种方法只能过滤掉UTF-8/UTF-16LE/UTF-16BE三种编码格式的文件,当文件是其他格式时,就会失效.只能使用另外一个工具了:UnicodeStream和UnicodeReader…
参考:http://www.cnblogs.com/findumars/p/3620078.html org.jdom2.input.JDOMParseException: Error on line 1: Content is not allowed in prolog. 13:15:55,821 [main] ERROR SajtSvrImpl:182 - 未知:org.jdom2.input.JDOMParseException: Error on line 1: Content is n…