stream should be an instance of a subclass of buffered-stream.
should should block until some data is available or return false at end of file. If data is available, it should place it in a buffer, set the stream's input buffer, index and limit appropriately and return a true value. The existing stream buffer can be reused if desired but the index and limit must be updated. The buffer must be of type
, whose element type matches that given when the stream was constructed.
There is a built-in method specialized on buffered-stream which usually suffices. It calls stream-read-buffer with the whole buffer and returns false if this call returns 0. If not, the input index is set to 0 and the input limit is set to the value returned by stream-read-buffer.