[ 
https://issues.apache.org/jira/browse/OAK-1188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13822562#comment-13822562
 ] 

Marcel Reutegger commented on OAK-1188:
---------------------------------------

{{BlobStoreInputStream}} does not implement buffered reads. Thus, every read 
call goes to the underlying {{BlobStore}}. The {{BlobStoreInputStream}} is not 
able to tell how many bytes it can provide next without blocking.

IMO returning zero is correct. If a client relies on some specific behavior of 
{{InputStream.available()}}, then it would also wrap the returned stream with a 
{{BufferedInputStream}}.

> Input streams returned from Blob instances should implement available()
> -----------------------------------------------------------------------
>
>                 Key: OAK-1188
>                 URL: https://issues.apache.org/jira/browse/OAK-1188
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: mk, mongomk, segmentmk
>            Reporter: Michael Dürig
>             Fix For: 0.12
>
>
> Currently {{blob.getNewStream().available()}} returns 0 for all Microkernels 
> (i.e for {{MicroKernelInputStream}}, {{SegmentStream}}, 
> {{BlobStoreInputStream}}). The method should instead return the number of 
> bytes available from that stream.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to