[phobos] Improvement of stream
Ellery Newcomer
ellery-newcomer at utulsa.edu
Mon Jul 5 07:10:02 PDT 2010
On 07/05/2010 12:37 AM, Andrei Alexandrescu wrote:
> - Input streams have the read primitive. What is wrong with an input
> range of ubyte[]? Then accessing front() gives you a buffer and
> popFront reads in a new buffer.
How do you handle heterogeneous reads? e.g.
ubyte[] x = new ubyte[](4);
inp.read(x);
ubyte[] y = new ubyte[](100);
inp.read(y);
> - What's the purpose of StreamWrapper?
Having input stream types which aren't runtime type compatible is kind
of a sucky situation. That's what the interfaces are for, and that's
what the wrapper provides for e.g. input streams which are structs.
> And why is it reading in the write() primitive?
heh heh
>
> - ByLine is a bit awkward because it needs to read buffers of size 1.
> Clearly there is some problem there. The right way is to build
> ByLine!Char on top of a stream of Char, not a stream of Char[].
> (Speaking of which, I just checked in BlockingInputReader. It does
> read one character at a time but it has an inefficiency caused by the
> FILE* interface.)
>
> - What does FileStream do that File doesn't or can't do?
>
> Let me know of what you think.
>
>
More information about the phobos
mailing list