#550 decompress gzip files bigger than 10000 bytes #594
+38
−28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The old implementation try to unzip the first 10,000 bytes of a gzip file. But if the file was bigger than 10,000 bytes a exception (Unexpected end of ZLIB input stream) was thrown while decompress file: pl/otros/logview/api/io/LoadingInfo.java:173
Solution:
Stacktrace that not logged in default:
23:20:35.284 [AWT-EventQueue-0] ERROR p.o.l.g.a.TailLogActionListener - Cannot open tailing input stream for file:///C:/Users/sven/test.log.gz, Unexpected end of ZLIB input stream java.io.EOFException: Unexpected end of ZLIB input stream at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:240) ~[na:1.8.0_322] at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158) ~[na:1.8.0_322] at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:117) ~[na:1.8.0_322] at java.io.FilterInputStream.read(FilterInputStream.java:107) ~[na:1.8.0_322] at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1309) ~[commons-io-2.11.0.jar:2.11.0] at org.apache.commons.io.IOUtils.copy(IOUtils.java:978) ~[commons-io-2.11.0.jar:2.11.0] at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1282) ~[commons-io-2.11.0.jar:2.11.0] at org.apache.commons.io.IOUtils.copy(IOUtils.java:953) ~[commons-io-2.11.0.jar:2.11.0] at pl.otros.logview.api.io.LoadingInfo.ungzip(LoadingInfo.java:173) ~[main/:na] at pl.otros.logview.api.io.LoadingInfo.<init>(LoadingInfo.java:63) ~[main/:na] at pl.otros.logview.api.io.LoadingInfo.<init>(LoadingInfo.java:51) ~[main/:na] at pl.otros.logview.gui.actions.TailLogActionListener.openFileObjectInTailMode(TailLogActionListener.java:77) [main/:na] at pl.otros.logview.gui.actions.TailLogActionListener.actionPerformedHook(TailLogActionListener.java:70) [main/:na] at pl.otros.logview.api.gui.OtrosAction.actionPerformed(OtrosAction.java:61) [main/:na] at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) [na:1.8.0_322] at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) [na:1.8.0_322] at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) [na:1.8.0_322] at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) [na:1.8.0_322] at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) [na:1.8.0_322] at org.pushingpixels.substance.internal.utils.RolloverButtonListener.mouseReleased(RolloverButtonListener.java:126) [substance-8.0.02.jar:na] at java.awt.Component.processMouseEvent(Component.java:6539) [na:1.8.0_322] at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) [na:1.8.0_322] at java.awt.Component.processEvent(Component.java:6304) [na:1.8.0_322] at java.awt.Container.processEvent(Container.java:2239) [na:1.8.0_322] at java.awt.Component.dispatchEventImpl(Component.java:4889) [na:1.8.0_322] at java.awt.Container.dispatchEventImpl(Container.java:2297) [na:1.8.0_322] at java.awt.Component.dispatchEvent(Component.java:4711) [na:1.8.0_322] at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904) [na:1.8.0_322] at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535) [na:1.8.0_322] at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476) [na:1.8.0_322] at java.awt.Container.dispatchEventImpl(Container.java:2283) [na:1.8.0_322] at java.awt.Window.dispatchEventImpl(Window.java:2746) [na:1.8.0_322] at java.awt.Component.dispatchEvent(Component.java:4711) [na:1.8.0_322] at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760) [na:1.8.0_322] at java.awt.EventQueue.access$500(EventQueue.java:97) [na:1.8.0_322] at java.awt.EventQueue$3.run(EventQueue.java:709) [na:1.8.0_322] at java.awt.EventQueue$3.run(EventQueue.java:703) [na:1.8.0_322] at java.security.AccessController.doPrivileged(Native Method) [na:1.8.0_322] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) [na:1.8.0_322] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84) [na:1.8.0_322] at java.awt.EventQueue$4.run(EventQueue.java:733) [na:1.8.0_322] at java.awt.EventQueue$4.run(EventQueue.java:731) [na:1.8.0_322] at java.security.AccessController.doPrivileged(Native Method) [na:1.8.0_322] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) [na:1.8.0_322] at java.awt.EventQueue.dispatchEvent(EventQueue.java:730) [na:1.8.0_322] at pl.otros.logview.exceptionshandler.EventQueueProxy.dispatchEvent(EventQueueProxy.java:31) [main/:na] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) [na:1.8.0_322] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) [na:1.8.0_322] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) [na:1.8.0_322] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [na:1.8.0_322] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) [na:1.8.0_322] at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) [na:1.8.0_322]
see also Issue #550