Re: how to create a binary output stream in SBCL
- From: Zach Beane <xach@xxxxxxxx>
- Date: 29 May 2007 20:36:34 -0400
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?
There isn't a built-in way to make a binary in-memory output
stream. It's pretty easy to make one for a file on disk:
(with-open-file (stream "file.jpg"
:direction :output
:element-type '(unsigned-byte 8))
(write-jpeg-to-stream s :image my-image))
Flexi-streams is a library that will let you make a binary in-memory
stream.
Zach
.
- References:
- how to create a binary output stream in SBCL
- From: Trastabuga
- how to create a binary output stream in SBCL
- Prev by Date: how to create a binary output stream in SBCL
- Next by Date: Re: Practical Common Lisp due for 3rd printing--send errata now
- Previous by thread: how to create a binary output stream in SBCL
- Next by thread: Re: how to create a binary output stream in SBCL
- Index(es):