This section describes how you can read from or write to a stream. Note that it is an error to call any of these functions on a buffered stream while its buffer is held by another thread; see Section 5.7 on page 51 for details about buffered streams.