[jira] [Comment Edited] (OAK-956) SegmentStream doesn't implement the method available()

2013-11-21 Thread Alexander Klimetschek (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13829072#comment-13829072
 ] 

Alexander Klimetschek edited comment on OAK-956 at 11/21/13 4:27 PM:
-

No, returning zero means the end of the inputstream has reached.

This is a regression: with the FileDataStore in Jackrabbit 2, which effectively 
used a FileInputStream, this worked. The FIS has the same situation, sometimes 
returning less bytes, but it implements available() properly. The code in Sling 
using the BIS is taken from Tomcat and stable.


was (Author: alexander.klimetschek):
No, returning zero means the end of the inputstream has reached.

This is a regression: with Jackrabbit, which effectively used a 
FileInputStream, this worked. The FIS has the same situation, sometimes 
returning less bytes, but it implements available() properly. The code in Sling 
using the BIS is taken from Tomcat and stable.

 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)


[jira] [Comment Edited] (OAK-956) SegmentStream doesn't implement the method available()

2013-11-20 Thread Alexander Klimetschek (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13828479#comment-13828479
 ] 

Alexander Klimetschek edited comment on OAK-956 at 11/21/13 4:30 AM:
-

Here is a test case reproducing the issue (in my git fork):

https://github.com/alexkli/jackrabbit-oak/commit/760dc1d613f1d0de4fb83084abb97c82d17c91a2
([patch|https://github.com/alexkli/jackrabbit-oak/commit/760dc1d613f1d0de4fb83084abb97c82d17c91a2.patch])

And here is a fix:

https://github.com/alexkli/jackrabbit-oak/commit/004b401ce74185b6343a7b8b27bccc5397a6da23
([patch|https://github.com/alexkli/jackrabbit-oak/commit/004b401ce74185b6343a7b8b27bccc5397a6da23.patch])

I am not sure what happens if there is an integer overflow (length  MAX_INT). 
{{available()}} is allowed to be just an estimate, so all it needs to do is 
return at least 1 if it knows there is more data available.


was (Author: alexander.klimetschek):
Here is a test case reproducing the issue (in my git fork):

https://github.com/alexkli/jackrabbit-oak/commit/760dc1d613f1d0de4fb83084abb97c82d17c91a2

And here is a fix:

https://github.com/alexkli/jackrabbit-oak/commit/004b401ce74185b6343a7b8b27bccc5397a6da23

I am not sure what happens if there is an integer overflow (length  MAX_INT). 
{{available()}} is allowed to be just an estimate, so all it needs to do is 
return at least 1 if it knows there is more data available.

 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)