Re: Overlap between StreamReader and FileReader

Moved to github.
https://github.com/tyoshino/stream/blob/master/streams.html
http://htmlpreview.github.io/?https://github.com/tyoshino/stream/blob/master/streams.html

On Wed, Jun 26, 2013 at 9:38 PM, Anne van Kesteren <annevk@annevk.nl> wrote:

> Calling the stream associated concepts the same as the variables in
>  the algorithm is somewhat confusing (read_position vs read_position).


Gave longer descriptive names to them.


> > 4. If called with the optional size, set the read_position of stream to
> > read_position + size.
> > 5. Otherwise, neuter the stream.
>
> Why would it be neutered if size is not given?
>

When size is not given, we need to mark it "fully read" by using something
else. I changed to use read position == -1.


> > 7. Read data from stream from read_position up to size bytes or all data
> is
> > size is not specified.
> > 8. As data from the stream becomes available, do the following,
>
> I think you need to define the stream buffer somewhat more explicitly
> so that only what you decide to read from the buffer ends up in the
> ArrayBuffer and newly queued data while that is happening is not.
>

Do you want FIFO model to be empathized?


> Probably defining Stream conceptually and defining read() (I don't
> think we should call it readAsArrayBuffer) in terms of those concepts
>

You mean that something similar to XHR's responseType is preferred?


> is better. E.g. similar to how http://url.spec.whatwg.org/ has a model
> and an API part.
>

Somewhat done.

Received on Monday, 1 July 2013 08:09:22 UTC