Author: jens
Date: Fri Aug 21 06:09:42 2015
New Revision: 1696897

URL: http://svn.apache.org/r1696897
Log:
InMemory: Fix a bug in length computation when reading partial content in some 
cases

Modified:
    
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/ContentStreamDataImpl.java

Modified: 
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/ContentStreamDataImpl.java
URL: 
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/ContentStreamDataImpl.java?rev=1696897&r1=1696896&r2=1696897&view=diff
==============================================================================
--- 
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/ContentStreamDataImpl.java
 (original)
+++ 
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/storedobj/impl/ContentStreamDataImpl.java
 Fri Aug 21 06:09:42 2015
@@ -229,7 +229,7 @@ public class ContentStreamDataImpl imple
     public ContentStream getCloneWithLimits(long offset, long length) {
         ContentStreamDataImpl clone = new ContentStreamDataImpl(0, 
doNotStoreContent);
         clone.fFileName = fFileName;
-        clone.fLength = length < 0 ? fLength : Math.min(fLength, length);
+        clone.fLength = length < 0 ? fLength - offset : Math.min(fLength - 
offset, length);
         clone.fContent = fContent;
         clone.fMimeType = fMimeType;
         clone.fStreamLimitOffset = offset;


Reply via email to