Class | Package: excl | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version

## string-simple-stream

This kind of stream allows for the moving and possible translation of characters.

One subclass of `string-simple-stream`, `composing-stream`, allows composing of external-formats and ligatures using Java-style encapsulations.

Other subclasses of `string-simple-stream` have 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 that is not a `composing-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 non-composing string-simple-streams operations:

- The basic unit of transfer is the character, not the octet.
- read-byte and write-byte will signal an error if given a string-simple-stream.
- No external-format processing is performed on the characters read or written, since the characters do not become external, but remain within the lisp during the round trip through the stream.
- Because CL specifies only input and output string streams (the classes `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.

Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version