jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r818844 - /jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/AbstractQValue.java
Date Fri, 25 Sep 2009 13:14:19 GMT
Author: thomasm
Date: Fri Sep 25 13:14:18 2009
New Revision: 818844

URL: http://svn.apache.org/viewvc?rev=818844&view=rev
Log:
JCR-2307 BLOBFileValue.read(byte[] b, long pos) ignores return value of InputStream.skip

Modified:
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/AbstractQValue.java

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/AbstractQValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/AbstractQValue.java?rev=818844&r1=818843&r2=818844&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/AbstractQValue.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/AbstractQValue.java
Fri Sep 25 13:14:18 2009
@@ -368,7 +368,14 @@
             public int read(byte[] b, long position) throws IOException, RepositoryException
{
                 InputStream in = getStream();
                 try {
-                    in.skip(position);
+                    long skip = position;
+                    while (skip > 0) {
+                        long skipped = in.skip(skip);
+                        if (skipped <= 0) {
+                            return -1;
+                        }
+                        skip -= skipped;
+                    }
                     return in.read(b);
                 } finally {
                     in.close();



Mime
View raw message