avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@apache.org>
Subject Re: [PATCH] IOUtil.java additions
Date Sat, 07 Jul 2001 06:42:50 GMT

Finally got around to committing it. I have removed the return statements. If 
we need to we can put them back. Putting them back in is backwards compatible 
but removing them would not be ;)

PS I am glad to see I am not the only one who still uses GNU style standards 
;) (old emacs user???)

On Thu,  5 Jul 2001 10:41, jeff wrote:
> Hi,
>
> In a dark corner of Excalibur lies a rather unexciting class called
> IOUtils.java. It lets you copy between InputStreams and OutputStreams,
> cleanly shut down streams, and that's it.
>
> Over the last week I have ruthlessly expanded it's functionality, such
> that there are now methods to copy from (InputStream|Reader|String) to
> (OutputStream|Writer|String), with variants to select the buffer size
> and (where appropriate) the byte->char encoding.
>
> Example uses:
>
> // Read text from a file to a String
> String s = IOUtil.toString( new FileReader("foo.txt") );
>
> // Copy the jakarta home page to a File:
> IOUtil.copy(
>     new URL("http://jakarta.apache.org").openStream(),
>     new FileOutputStream("index.html")
>     ).close();
>
> etc.
>
> Lots of Javadocs, and a test suite to ensure it behaves itself
> (IOUtilsTestlet.java).
>
> --Jeff

----------------------------------------
Content-Type: text/plain; charset="us-ascii"; name="Attachment: 1"
Content-Transfer-Encoding: 7bit
Content-Description: 
----------------------------------------

----------------------------------------
Content-Type: text/plain; charset="us-ascii"; name="Attachment: 2"
Content-Transfer-Encoding: 7bit
Content-Description: 
----------------------------------------

-- 
Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*

---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org


Mime
View raw message