commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacob Kjome (JIRA)" <j...@apache.org>
Subject [jira] Commented: (IO-158) ReaderInputStream implementation
Date Tue, 27 May 2008 21:08:59 GMT

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

Jacob Kjome commented on IO-158:
--------------------------------

I see your point.  From InputStream.read(byte[], int, int) javadoc...

"If len is zero, then no bytes are read and 0 is returned; otherwise, there is an attempt
to read at least one byte."

Then again, I bet few would experience failure due to this issue in normal use making a reasonable
argument for this being considered an "edge case", even while acknowledging that it is clear
a violation of specification behavior and should be fixed.

So, I guess the openide ReaderInputStream contains at least one bug.  But it's pretty simple
to fix.  Otherwise, it seems like it is pretty robust.  So, disregarding whether or not this
is an "edge case", any comment on whether this implementation (or one like it) shows promise?

> ReaderInputStream implementation
> --------------------------------
>
>                 Key: IO-158
>                 URL: https://issues.apache.org/jira/browse/IO-158
>             Project: Commons IO
>          Issue Type: Wish
>            Reporter: Andreas Veithen
>            Priority: Minor
>
> The standard Java class InputStreamReader converts a Reader into an InputStream. In some
cases it is necessary to do the reverse, i.e. to convert a Reader into an InputStream. Several
frameworks and libraries have their own implementation of this functionality (google for "ReaderInputStream").
Among these are at least four Apache projects: Ant, iBatis, James and XMLBeans. Commons IO
would be a good place to share a common implementation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message