[
https://issues.apache.org/jira/browse/OAK-956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jukka Zitting resolved OAK-956.
-------------------------------
Resolution: Duplicate
Resolving as a duplicate of OAK-1188 where we already handled this case.
Alex, you're misunderstanding how BIS works. It *doesn't* guarantee that
{{read()}} always returns the requested number of bytes. See the [BIS.read(...)
javadocs|http://docs.oracle.com/javase/7/docs/api/java/io/BufferedInputStream.html#read(byte%5B%5D%2C%20int%2C%20int)]:
{quote}
As an additional convenience, it attempts to read as many bytes as possible by
repeatedly invoking the read method of the underlying stream. This iterated
read continues until one of the following conditions becomes true:
* The specified number of bytes have been read,
* The read method of the underlying stream returns -1, indicating end-of-file,
or
* The available method of the underlying stream returns zero, indicating that
further input requests would block.
{quote}
In other words, it *does not guarantee* that the requested number of bytes is
read fully. Only that it does so in case the underlying stream reports through
{{available()}} that this can be done without blocking.
> SegmentStream doesn't implement the method available()
> ------------------------------------------------------
>
> Key: OAK-956
> URL: https://issues.apache.org/jira/browse/OAK-956
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: core
> Reporter: Antonio Sanso
>
> org.apache.jackrabbit.oak.plugins.segment.SegmentStream doesn't implement
> the method available()
> {code}
> Value.getStream().available()
> {code}
> will always return 0
--
This message was sent by Atlassian JIRA
(v6.1#6144)