You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Mandeep Gandhi (JIRA)" <ji...@apache.org> on 2016/02/25 09:12:18 UTC

[jira] [Created] (OAK-4057) available() in SegmentStream returning 0 for large files

Mandeep Gandhi created OAK-4057:
-----------------------------------

             Summary: available() in SegmentStream returning 0 for large  files
                 Key: OAK-4057
                 URL: https://issues.apache.org/jira/browse/OAK-4057
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: segmentmk
            Reporter: Mandeep Gandhi
             Fix For: 1.3.15


Suppose I have a file  in repository. I try to get input stream from the file as 

                InputStream is = jcrContent.getProperty("jcr:data").getBinary().getStream();

Now before building the document I want to check if the file is not empty by using using available API. 

Ideally this API is expected to return an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input streamfhttps://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html#available()

The API works fine for small files but for large ones it returns 0. 
 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)