Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
January 09, 2007 writeBlock called from readBlock? | ||||
---|---|---|---|---|
| ||||
BufferStream's writeBlock calls readBlock. Is it supposed to, or is it a bug? |
January 09, 2007 writeBlock calls readBlock? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dan | == Quote from Dan (ddaglas@gmail.com)'s article
> BufferStream's writeBlock calls readBlock. Is it supposed to, or is it a bug?
Sorry, rephrased subject line to reflect the content of the message.
--Dan
|
January 09, 2007 Re: writeBlock called from readBlock? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dan | "Dan" <ddaglas@gmail.com> wrote in message news:env9tv$ouo$1@digitaldaemon.com... > BufferStream's writeBlock calls readBlock. Is it supposed to, or is it a bug? Strange, I really don't know why it's doing this: from std.stream.BufferedStream: # override size_t writeBlock(void* result, size_t len) { # assertWriteable(); # # ubyte* buf = cast(ubyte*)result; # size_t writesize = 0; # # if (bufferLen == 0) { # // buffer is empty so fill it if possible # if ((len < buffer.length) && (readable)) { # // read in data if the buffer is currently empty # bufferLen = s.readBlock(buffer.ptr, buffer.length); # bufferSourcePos = bufferLen; # streamPos += bufferLen; Why "buffer is empty so fill it if possible" ??? L. |
Copyright © 1999-2021 by the D Language Foundation