First part of ALF-16687 Update to CMIS 0.8

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@43422 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Andrew Hind
2012-11-06 20:47:55 +00:00
parent 3207b61c1c
commit d799210bd1
2 changed files with 7 additions and 2 deletions

View File

@@ -1209,8 +1209,8 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
else
{
long off = (offset == null ? 0 : offset.longValue());
long len = (length == null ? contentReader.getSize() : length.longValue()) - off;
if (len > contentReader.getSize())
long len = (length == null ? contentReader.getSize() : length.longValue());
if (off + len > contentReader.getSize())
{
len = contentReader.getSize() - off;
}

View File

@@ -65,6 +65,11 @@ public class RangeInputStream extends InputStream
@Override
public int read(byte[] b, int off, int len) throws IOException
{
if(length - bytesRead == 0)
{
return -1;
}
if (len > length - bytesRead)
{
len = (int) (length - bytesRead);