[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    [jira] [Commented] (IO-713) ReaderInputStream documentation regarding available() is incorrect
From:       "Marcono1234 (Jira)" <jira () apache ! org>
Date:       2021-10-31 17:20:00
Message-ID: JIRA.13356344.1612320043000.1204617.1635700800060 () Atlassian ! JIRA
[Download RAW message or body]


    [ https://issues.apache.org/jira/browse/IO-713?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17436511#comment-17436511 \
] 

Marcono1234 commented on IO-713:
--------------------------------

Sorry for the delay; I have created https://github.com/apache/commons-io/pull/291 for \
this now.

> ReaderInputStream documentation regarding available() is incorrect
> ------------------------------------------------------------------
> 
> Key: IO-713
> URL: https://issues.apache.org/jira/browse/IO-713
> Project: Commons IO
> Issue Type: Bug
> Components: Streams/Writers
> Affects Versions: 2.8.0
> Reporter: Marcono1234
> Priority: Minor
> 
> The documentation for {{org.apache.commons.io.input.ReaderInputStream}} says:
> {quote}
> Given the fact that the Reader class doesn't provide any way to predict whether the \
> next read operation will block or not, it is not possible to provide a meaningful \
> implementation of the InputStream.available() method. A call to this method will \
> always return 0. {quote}
> However, {{Reader}} does actually provide such functionality: \
> [{{Reader.ready()}}|https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Reader.html#ready()].
>  But properly implementing {{available()}} might be tricky, see [related Guava pull \
> request|https://github.com/google/guava/pull/5397]. Therefore it might be easiest \
> to change the documentation, stating that {{available()}} always returns 0 without \
> providing a reason for it. Or {{available()}} could at least return a result based \
> on {{encoderOut}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic