How to make an in memory input/output stream?



Hi,

I am trying to write some binary data.
Now I want to have an easy way to test the data I wrote to the stream.

Knowing (with-output-to-string) and (with-input-from-string) I am
thinking of something along this style, but with element-type as 'byte.

(let ((io (make-buffer)))
(write-the-binary (buffer-output-stream io))
(test-the-binary (buffer-input-stream io)))

However, in Hypersepc there is no way to create an output stream that
write to memory. Is there any portable way to do this? I know that I
could write to a temp file and read back, but it doesn't seems like the
clean way to do it.

Regards,

.



Relevant Pages

  • Re: Performance issues with BinaryReader/BinaryWriter
    ... unwanted character set conversions. ... send a stream of binary data that could not be altered by the receiver. ... and the various conversions the .NET does automatically. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Manipulation of Binary Numbers
    ... David, ... When i meant binary data stream, ... i an then storing this data into arrays. ...
    (comp.soft-sys.matlab)
  • Re: Some questions about the IO package
    ... are intended for reading/writing binary data, ... Nearly all Readers and Writers are attached to an InputStream or OutputStream, ... The other stream classes are relatively unimportant. ...
    (comp.lang.java.programmer)
  • Re: accessing binary (blob) data from SQL server
    ... One thing I had utilize though was the MidB ... >>I'm struggling a bit reading binary data from a database. ... I played around with the stream object. ... GetChunk is one of them, ...
    (microsoft.public.inetserver.asp.db)
  • Re: simple encryption
    ... >> It only has one constructor, and it NEEDS some type of stream! ... As I said before, encryption fundamentally revolves around ... > binary data, not text. ... > from text to binary and the reverse before doing anything else. ...
    (microsoft.public.dotnet.languages.csharp)