commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1350881 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
Date Sat, 16 Jun 2012 08:06:29 GMT
Author: bodewig
Date: Sat Jun 16 08:06:28 2012
New Revision: 1350881

URL: http://svn.apache.org/viewvc?rev=1350881&view=rev
Log:
don't read if you know the stream is already exhausted

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java?rev=1350881&r1=1350880&r2=1350881&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
Sat Jun 16 08:06:28 2012
@@ -245,11 +245,11 @@ public class BZip2CompressorInputStream 
         }
 
         int magic0 = this.in.read();
-        int magic1 = this.in.read();
-        int magic2 = this.in.read();
         if (magic0 == -1 && !isFirstStream) {
             return false;
         }
+        int magic1 = this.in.read();
+        int magic2 = this.in.read();
 
         if (magic0 != 'B' || magic1 != 'Z' || magic2 != 'h') {
             throw new IOException(isFirstStream



Mime
View raw message