By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

报错信息:
java.io.EOFException: Unexpected end of ZLIB input stream
at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:245)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:115)
at java.io.FilterInputStream.read(FilterInputStream.java:107)
at com.example.logdemo.LoganParser.parse(LoganParser.java:77)
at com.example.logdemo.MainActivity$1.onClick(MainActivity.java:50)
at android.view.View.performClick(View.java:5647)
at android.view.View$PerformClick.run(View.java:22465)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6388)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:930)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:820)

我也有这个问题。我也是直接丢进去的。解析出来好多没有后半边括号的。

ed","f":1,"l":1551254557594,"n":"main","i":2,"m":true{"c":"Lagan is init-ed","f":1,"l":1551254557880,"n":"main","i":2,"m":true{"c":"Lagan is init-ed","f":1,"l":1551254803353,"n":"main","i":2,"m":true{"c":"Lagan is init-ed","f":1,"l":1551254803677,"n":"main","i":2,"m":true{"c":"Lagan is init-ed","f":1,"l":1551254910909,"n":"main","i":2,"m":true{"c":"Lagan is init-ed","f":1,"l":1551254911191,"n":"main","i":2,"m":true}{"c":"Lagan is init-ed","f":1,"l":1551255252670,"n":"main","i":2,"m":true

不知道是写入过程的问题还是解密过程的问题。

HttpServletRequest request ) throws IOException { LoganTaskModel model = RequestContextParser . parse ( request ); ResultEnum result = loganLogFileService . write ( request . getInputStream (), model . getLogFileName ()); if ( ResultEnum . SUCCESS != result ) { return LoganResponse . exception ( result . name ()); long addResult = loganTaskService . insertTask ( model ); // 保存后马上解析 if ( addResult > 0 ) { LoganTaskDTO task = loganTaskService . getDtoByTaskId ( addResult ); if ( task != null ) { loganLogDetailService . tryAnalyze ( task ); return addResult > 0 ? LoganResponse . success ( FileUtil . getDownloadUrl ( request , model . getLogFileName ())) : LoganResponse . exception ( ResultEnum . ERROR_DATABASE . name ()); HttpServletRequest request ) throws IOException { LoganTaskModel model = RequestContextParser . parse ( request ); ResultEnum result = loganLogFileService . write ( request . getInputStream (), model . getLogFileName ()); if ( ResultEnum . SUCCESS != result ) { return LoganResponse . exception ( result . name ()); long addResult = loganTaskService . insertTask ( model ); // 保存后马上解析 if ( addResult > 0 ) { LoganTaskDTO task = loganTaskService . getDtoByTaskId ( addResult ); if ( task != null ) { loganLogDetailService . tryAnalyze ( task ); return addResult > 0 ? LoganResponse . success ( FileUtil . getDownloadUrl ( request , model . getLogFileName ())) : LoganResponse . exception ( ResultEnum . ERROR_DATABASE . name ());

客户端后台的时候调flush了吗