commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r1401552 - in /commons/proper/imaging/trunk/src: changes/changes.xml main/java/org/apache/commons/imaging/common/bytesource/ByteSourceInputStream.java
Date Wed, 24 Oct 2012 05:08:19 GMT
Author: damjan
Date: Wed Oct 24 05:08:19 2012
New Revision: 1401552

URL: http://svn.apache.org/viewvc?rev=1401552&view=rev
Log:
ByteSourceInputStream.streamLength could be a long

Jira issue key: IMAGING-91


Modified:
    commons/proper/imaging/trunk/src/changes/changes.xml
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/bytesource/ByteSourceInputStream.java

Modified: commons/proper/imaging/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/changes/changes.xml?rev=1401552&r1=1401551&r2=1401552&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/changes/changes.xml (original)
+++ commons/proper/imaging/trunk/src/changes/changes.xml Wed Oct 24 05:08:19 2012
@@ -233,6 +233,9 @@ The <action> type attribute can be add,u
       <action issue="IMAGING-92" dev="damjan" type="fix" due-to="hmarmy">
         Issue trying to update GPS metadata info in a JPG.
       </action>
+      <action issue="IMAGING-91" dev="damjan" type="update">
+         ByteSourceInputStream.streamLength could be a long.
+      </action>
     </release>
     
   </body>

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/bytesource/ByteSourceInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/bytesource/ByteSourceInputStream.java?rev=1401552&r1=1401551&r2=1401552&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/bytesource/ByteSourceInputStream.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/bytesource/ByteSourceInputStream.java
Wed Oct 24 05:08:19 2012
@@ -168,7 +168,7 @@ public class ByteSourceInputStream exten
         // We include a separate check for int overflow.
         if ((blockStart < 0) || (blockLength < 0)
                 || (blockStart + blockLength < 0)
-                || (blockStart + blockLength > streamLength.longValue())) {
+                || (blockStart + blockLength > streamLength)) {
             throw new IOException("Could not read block (block start: "
                     + blockStart + ", block length: " + blockLength
                     + ", data length: " + streamLength + ").");
@@ -191,12 +191,12 @@ public class ByteSourceInputStream exten
         }
     }
 
-    private Long streamLength = null;
+    private long streamLength = -1;
 
     @Override
     public long getLength() throws IOException {
-        if (streamLength != null) {
-            return streamLength.longValue();
+        if (streamLength >= 0) {
+            return streamLength;
         }
 
         InputStream is = getInputStream();



Mime
View raw message