This kind of stream has a single buffer which is in fact a string. It
is available as an optimization to allow read and format at a high
level to be used on strings. For resourcing, the string for the stream
may be specified by a :string
option
to make-instance, which is then passed to device-open as an options flag, or
the string for a string-output-simple-stream may be reused if it
already exists in the stream.
A string stream incorporates a major exception in the CL requirements for the streams system: there is no external connection; everything that lisp is reading from or writing to the stream is within the lisp heap, and thus there are no reconnect or shutdown problems with these streams; they continue to work across a dumped lisp image that has been restarted.
Specific exceptions to string-simple-streams operations:
string-input-simple-stream
and string-output-simple-stream
and
perhaps further subclasses), but not bidirectional, it is not
necessary to implement mode switching internally for the single string buffer. Implementations are free to define such a bidirectional string
stream (or to emulate such a stream - see note just below). Note: something similar to string streams could be implemented, with less efficient operation, by simulating an external-connection at the device level of either a single-channel or dual-channel stream. The "final destination" (or source) of the device would in that case be a string, and the extra octet buffering would require extra copying at the device level when transferring data out (or in). This technique would allow external-format processing on the strings either during input or output.
The documentation is described in introduction.htm and the index is in index.htm.
Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.
Created 2000.10.5.