All Manuals > LispWorks User Guide and Reference Manual > 48 The STREAM Package

NextPrevUpTopContentsIndex

buffered-stream

Class
Summary

A stream class giving access to stream buffers.

Package

stream

Superclasses

fundamental-stream

Subclasses

lob-stream
string-stream
socket-stream

Initargs

:direction

One of :input, :output or :io. This argument is required.

:element-type

One of base-char, bmp-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, and you must supply a 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

(example-edit-file "streams/buffered-stream")
See also

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


LispWorks User Guide and Reference Manual - 13 Feb 2015

NextPrevUpTopContentsIndex