做了一个日志统计程序,入库的时候发生MalformedInputException,不知道怎么解决?
问题比较严重,必须避免这个异常,请各位大侠救命啊。
------解决方法--------------------------------------------------------
看看这个异常的说明:
Checked exception thrown when an input byte sequence is not legal for given charset, or an input character sequence is not a legal sixteen-bit Unicode sequence.
http://www.javayou.com
------解决方法--------------------------------------------------------
读文件时指定其编码
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(sourceFilePath), fileEncoding));