The class
buffered-stream
provides default methods for the majority of the functions in the User Defined Streams protocol. The default methods implement buffered I/O, requiring the user to define only the methods stream-read-buffer, stream-write-buffer and stream-element-type for each subclass of
buffered-stream
. You are at liberty to redefine other methods in subclasses as long as they obey the rules outlined here. For example it is usually desirable to implement methods on stream-listen, stream-check-eof-no-hang and close as well.
The initargs are handled by the method
(method initialize-instance :after (buffered-stream))
as follows:
Input and/or output buffers are created based on the value direction . There is no default value.
element-type
determines the stream-element-type of the stream. The default is
base-char
. For binary streams, use
base-char
.
All the methods in the User Defined Streams protocol are defined for
buffered-stream
as follows:
:around
methods on stream-listen and close which handle the buffer.
:direction
initarg.
close
stream-flush-buffer
stream-fill-buffer
stream-listen
stream-read-buffer
stream-write-buffer
with-stream-input-buffer