开发者

How to create a binary stream (not a file) in Common Lisp?

开发者 https://www.devze.com 2023-04-05 12:16 出处:网络
I have a function which output some binary data to a stream. But the stream is abstract, which means the stream can be a file stream, or some other streams. But the stream must be a binary stream whic

I have a function which output some binary data to a stream. But the stream is abstract, which means the stream can be a file stream, or some other streams. But the stream must be a binary stream which supp开发者_运维知识库ort write-byte function. I searched but not found the answer.

What I want to do is, I have a function which will convert some data to a gif. But I donot want to output the data to a file, I want to output it to something in memory.

Thanks.


The flexi-streams library provides, among other things, in-memory binary streams.


"File in memory" - is just a byte array. So all you need is to read your data from stream and write it to one-dimensional array (vector). For more information on arrays in CL see this.

0

精彩评论

暂无评论...
验证码 换一张
取 消