Re: Bits from a stream



"Alan Manuel K. Gloria" <almkglor@xxxxxxxxx> writes:

I'm currently trying to figure out how bits work in CL.

You can access the bits of an integer with functions like LDB and
LOGAND. You can produce integers with modified bits with functions
like DPB and LOGIOR. You can perform bitwise shifts with ASH. You can
test individual bits with LOGBITP or groups of bits with LOGTEST.

There are many more functions for accessing and operating on the bits
of an integer. See the numbers dictionary for a list:

http://www.lispworks.com/documentation/HyperSpec/Body/c_number.htm

Basically I need to do some compression on some data I'm storing - the
way I keep my data is rather amenable to compression, but compressing
it requires access to individual bits. I would like to store and
retrieve data from a file, so I will need access to bits in a stream.

I have written a few bitstream functions for a Flash file
reader/writer. They are available here:

http://www.xach.com/lisp/cl-flash/bitio.lisp

It will allow you to both read and write variable-length contiguous
bits across octet boundaries in an (UNSIGNED-BYTE 8) stream. There
isn't much to it.

Okay, so maybe I'll dredge through the hyperspec and figure out what
names CL gives to bitwise or/and and bit shifting.

This is a very good idea in general.

Zach
.



Relevant Pages

  • AidAim CryptoPressStream 2.00
    ... CryptoPressStream is a streaming compression and encryption library. ... in the stream object. ...
    (comp.software.shareware.announce)
  • Using compression with encryption
    ... I am developing an internal compression format. ... encryption as well. ... open cryptographic output stream above this stream ... first with GZipStream and then encrypted with CryptoStream ...
    (microsoft.public.dotnet.framework)
  • Using compression with encryption
    ... I am developing an internal compression format. ... encryption as well. ... open cryptographic output stream above this stream ... first with GZipStream and then encrypted with CryptoStream ...
    (microsoft.public.dotnet.framework)
  • Re: Standard Interface for Data Compression Algorithms
    ... here is a multiplexed stream format, ... "Standard Interface for Data Compression Algorithms". ...
    (comp.compression)
  • Re: Cannot connect input to ACM Wrapper
    ... after adding the filter to the graph and before connecting ... If you want to compress the stream, add an audio compressor, ... If you use the WMASFWriter and want to compress to WMA, ... profile and not configure it to bypass compression. ...
    (microsoft.public.win32.programmer.directx.audio)