Re: how to create a binary output stream in SBCL



Trastabuga <lispercat@xxxxxxxxx> writes:

I am trying to write an image to the stream so when I do this:
(let ((s (make-string-output-stream :element-type '(unsigned-byte
8))))
(write-jpeg-to-stream s :image my-image))

Lisp complains: #<SB-IMPL::STRING-OUTPUT-STREAM {C939499}> is not a
binary output stream.

How can I make a binary output stream?

Simple-streams (from Allegro CL, but also available to some extent on
other lisps) defines a buffer-output-simple-stream - see
http://www.franz.com/support/documentation/8.0/doc/classes/excl/buffer-output-simple-stream.htm
which is analogous to a string-stream. Also available are the
functions with-output-to-buffer and make-buffer-output-stream, linked
from that page.

--
Duane Rettig duane@xxxxxxxxx Franz Inc. http://www.franz.com/
555 12th St., Suite 1450 http://www.555citycenter.com/
Oakland, Ca. 94607 Phone: (510) 452-2000; Fax: (510) 452-0182
.