Deutsch   English   Français   Italiano  
<va4lv6$3rpl4$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!2.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP>
Newsgroups: comp.os.vms
Subject: Re: New VSI post on Youtube
Date: Wed, 21 Aug 2024 12:18:46 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <va4lv6$3rpl4$1@dont-email.me>
References: <v9ehs5$3mqbj$1@dont-email.me> <v9idff$f9k4$1@dont-email.me> <v9iqln$hrs3$1@dont-email.me> <v9iro6$fql6$1@dont-email.me> <66bcf876$0$717$14726298@news.sunsite.dk> <66bcfbe3$0$717$14726298@news.sunsite.dk> <v9kske$uqhh$2@dont-email.me> <va04hl$2viks$2@dont-email.me> <66c397f6$0$716$14726298@news.sunsite.dk> <va2280$3cdrf$3@dont-email.me> <va28d7$3cunf$3@dont-email.me> <va2kb4$3f8oq$2@dont-email.me> <va2np6$3f2e6$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 21 Aug 2024 14:18:46 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="6040447a229c0a789cfde0015532b4de";
	logging-data="4056740"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18VyQTtUhUAqBnABJo57a+uxM5v/+Hx1/M="
User-Agent: slrn/0.9.8.1 (VMS/Multinet)
Cancel-Lock: sha1:Ts1VTKLw/3T58m2G3HquvNvrVfE=
Bytes: 3107

On 2024-08-20, Arne Vajhøj <arne@vajhoej.dk> wrote:
> On 8/20/2024 1:38 PM, Simon Clubley wrote:
>> 
>> You forgot about InputStreamReader() to turn an InputStream into a Reader. :-)
>
> There are InputStreamReader to convert from InputStream to Reader and
> OutputStreamWriter to convert from OutputStream to Writer.
>
> And they are actually used, because some API's has classes that only has
> getInputStream()/getOutputStream() methods and not
> getReader()/getWriter() methods.
>
> All follow the model.
>
>> After all, why miss the opportunity to have two parallel sets of APIs
>> (byte versus character) instead of just the one API ? :-)
>> 
>> Goodness knows why they didn't just add something like String's getBytes()
>> method to the character APIs or add character support to the byte APIs...
>
> Because InputStream/OutputStream and Reader/Writer are fundamentally
> different.
>

I may not have stated that clearly enough.

The character model is built in top of a byte model, with character-specific
knowledge in the character classes.

The traditional Java way to add this additional functionality is to extend
a class in a subclass and implement the additional functionality in the
subclass.

I am having a hard time seeing why they didn't just extend the byte I/O
classes in this way to implement additional character functionality so
that both character and byte I/O directly uses an InputStream (and likewise
for an OutputStream). There should be no need for a character-specific
Reader concept or an InputStreamReader() converter.

Simon.

-- 
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.