dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]OT: rant on ECMA BCL


From: Rhys Weatherley
Subject: Re: [DotGNU]OT: rant on ECMA BCL
Date: Sat, 27 Apr 2002 08:47:14 +1000

S11001001 wrote:
 
> But annoying bastard BCL thinks that there should only be one posn property,
> and it changes when you read and changes when you write.

All of the Stream classes are designed to emulate
file-like behaviours, so that streams can be used
interchangeably.  In files, there is only one
position, at which both reading and writing occurs.

A FIFO-like memory stream would be nice, but its
behaviour isn't consistent across stream types.

> Should the lowest possible position for a stream always be 0? Don't see info 
> anywhere in the spec.

Yes.  If the stream starts at index 3 in a buffer,
then index 3 corresponds to position 0.  This can
be easily accomodated by keeping a private "start"
field that is used to adjust all positions to turn
them into indexes.  Once again, this is to emulate
files, where you can always seek to the beginning
of the stream using position 0.

Cheers,

Rhys.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]