Re: What replaces StringBufferInputStream
- From: Lasse Reichstein Nielsen <lrn@xxxxxxxxxx>
- Date: Wed, 30 Aug 2006 11:41:47 +0200
"M.J. Dance" <mjdance@xxxxxxxxxxx> writes:
That seems to be the problem with this input stream <-> reader (and
output stream <-> writer, for that matter) dichotomy. Every(?) reader
has an uderlying input stream which, I imagine, wouldn't be a problem
to obtain.
Except, e.g., StringReader.
If you are communicating between processes, or even computers, then at
some point you'll represent your data as the lowest common
denominator: bytes, but working inside a single program, you can start
out with characters and keep it that way.
There is no way to meaningfully convert a generic Writer to an
OutputStream, and it's an implementation detail whether there is an
underlying OutputStream for a given Writer, so the Writer interface
can't meaningfully expose a method for giving out an OutputStream.
On the opposite end, you shouldn't blindly convert an InputStream
to a Reader without knowing that the bytes do represent characters
in the encoding you have chosen.
/L
--
Lasse Reichstein Nielsen - lrn@xxxxxxxxxx
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
.
- Follow-Ups:
- Re: What replaces StringBufferInputStream
- From: Chris Uppal
- Re: What replaces StringBufferInputStream
- References:
- What replaces StringBufferInputStream
- From: Patricia Shanahan
- Re: What replaces StringBufferInputStream
- From: Arne Vajhøj
- Re: What replaces StringBufferInputStream
- From: Patricia Shanahan
- Re: What replaces StringBufferInputStream
- From: vahan
- Re: What replaces StringBufferInputStream
- From: Patricia Shanahan
- Re: What replaces StringBufferInputStream
- From: Lasse Reichstein Nielsen
- Re: What replaces StringBufferInputStream
- From: Patricia Shanahan
- Re: What replaces StringBufferInputStream
- From: M.J. Dance
- What replaces StringBufferInputStream
- Prev by Date: Re: referring to a java class in Eclipse folders
- Next by Date: Re: parsing multiple files
- Previous by thread: Re: What replaces StringBufferInputStream
- Next by thread: Re: What replaces StringBufferInputStream
- Index(es):
Relevant Pages
|