S
Steven T. Hatton
I haven't looked very closely, but from what I'm seeing, it looks like there
are no buffered I/O streams in the Standard Library. There are stream
buffers, but not buffered streams. I don't have an excellent definition of
what a buffered stream is right off the top of my head, but it's something
like a cache that can hold data from the source, or for the destination
that can't be immediately processed. Say, for example, if you are
streaming to a network socket that sends data in larger chunks than your
process produces per output operation. You don't want to send an almost
empty packet every time you write to the stream, then sit around an wait
till the output stream becomes available again when the network driver
finishes its transmission. So you write to a buffer from which the network
driver reads.
Does the standard library not provide a generic buffered stream?
are no buffered I/O streams in the Standard Library. There are stream
buffers, but not buffered streams. I don't have an excellent definition of
what a buffered stream is right off the top of my head, but it's something
like a cache that can hold data from the source, or for the destination
that can't be immediately processed. Say, for example, if you are
streaming to a network socket that sends data in larger chunks than your
process produces per output operation. You don't want to send an almost
empty packet every time you write to the stream, then sit around an wait
till the output stream becomes available again when the network driver
finishes its transmission. So you write to a buffer from which the network
driver reads.
Does the standard library not provide a generic buffered stream?