NextPrevUpTopContentsIndex

buffered-stream

Class
Summary

A stream class giving access to stream buffers.

Package

stream

Superclasses

fundamental-stream

Subclasses

string-stream

Initargs

:direction

One of :input , :output or :io

:element-type

One of base-char , simple-char or character .

Description

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:

Example

See the extended example in examples/streams/buffered-stream.lisp

See also

close
stream-flush-buffer
stream-fill-buffer
stream-listen
stream-read-buffer
stream-write-buffer
with-stream-input-buffer


LispWorks Reference Manual - 23 Jul 2004

NextPrevUpTopContentsIndex