文件解析java.io.BufferedReader.readLine

sun.io.MalformedInputException
at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java:262)
at sun.nio.cs.StreamDecoder$ConverterSD.convertInto(StreamDecoder.java:314)
at sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:364)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:250)
at java.io.InputStreamReader.read(InputStreamReader.java:212)
at java.io.BufferedReader.fill(BufferedReader.java:157)
at java.io.BufferedReader.readLine(BufferedReader.java:320)
at java.io.BufferedReader.readLine(BufferedReader.java:383)
at com.fenet.insurance.mm.imvvt.jfcd.JfcdFiletypeReader.reader(JfcdFiletypeReader.java:228)
at com.fenet.insurance.mm.imvvt.jfcd.JfcdFiletypeReader.read(JfcdFiletypeReader.java:511)
at com.fenet.insurance.mm.imvvt.jfcd.JfcdFiletypeChannel$1.run(JfcdFiletypeChannel.java:34)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:432)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:284)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:80)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:183)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:810)
今天在解析一文件的时候,解析不过去,看了日志就报了这个错,其实原因很简单,就是因为你解析的文件编码方式不一致,解析的文件要求的编码方式为utf-8或gbk的,而你的unicode,由于之前没碰到过这样的问题,所以调试发现输出的值和看到的不一致,后改了编码方式就对了。

你可能感兴趣的:(文件解析java.io.BufferedReader.readLine)