[
https://issues.apache.org/jira/browse/IO-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599276#action_12599276
]
Jacob Kjome commented on IO-158:
--------------------------------
Interesting. I just came upon the need for this the other day using the SAAJ
API, which accepts only an InputStream and I have a String to pass in (no
access to the original stream). Low and behold, such functionality is being
considered for inclusion in commons-io! We certainly won't be seeing it as a
standard Java class anytime soon [1], except maybe in the openJDK project [2].
BTW, Hibernate uses an essentially identical implementation [3] as the one in
James. And you're right, it's not a good candidate.
However, I thought I'd point out one other implementation of ReaderInputStream
from the Netbeans project that appears reasonably robust [4][5]. In contrast
to the other implementations, it uses PipedInputStream and PipedOutputStream
(no test for it, unfortunately [6]). I think it's worth a look, though I'm not
sure it's compatible with Apache licensing [7]? So, if the Piped Input/Output
Streams concept is desirable, maybe it's better *not* to look at it and
implement it yourselves to avoid any conflict? I'll let you all decide.
Jake
[1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4103785
[2] http://openjdk.java.net/
[3]
http://www.jdocs.com/hibernate/3.2.5/org/hibernate/lob/ReaderInputStream.html
[4]
http://hg.netbeans.org/main/file/50bd9aed0840/openide.util/src/org/openide/util/io/ReaderInputStream.java
[5]
http://bits.netbeans.org/dev/javadoc/org-openide-util/org/openide/util/io/ReaderInputStream.html
[6]
http://hg.netbeans.org/main/file/50bd9aed0840/openide.util/test/unit/src/org/openide/util/io/
[7] http://www.netbeans.org/cddl-gplv2.html
> 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.