Thread overview
writeBlock called from readBlock?
Jan 09, 2007
Dan
writeBlock calls readBlock?
Jan 09, 2007
Dan
Jan 09, 2007
Lionello Lunesu
January 09, 2007
BufferStream's writeBlock calls readBlock.  Is it supposed to, or is it a bug?
January 09, 2007
== 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
"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.