A bivalent stream can be used to read and write both
character
and (unsigned-byte 8)
values. A bivalent
stream is created by calling open
with the argument :element-type
:default
. On such a stream, both binary and character data can be
read and written with the usual input and output functions.
Streams are not created bivalent by default for performance reasons. Bivalent streams are incompatible withfast-read-char
, an internal optimization in sbcl's stream machinery that bulk-converts octets to characters and implements a fast path throughread-char
.