Re: Bits from a stream
- From: Pascal Bourguignon <usenet@xxxxxxxxxxxxxxxxx>
- Date: Mon, 20 Mar 2006 16:31:53 +0100
"Alan Manuel K. Gloria" <almkglor@xxxxxxxxx> writes:
Otherwise, your READ-BIT function is wrong. You've not proved it,That's weird. I've tried it. It seems to work....
it's clear, but did you even try it?
All right, my fault, I expected something else.
Indeed, your routine works.
[323]> (with-open-file (out "/tmp/bits" :direction :output
:element-type '(unsigned-byte 8))
(write-sequence '(#xf0 #xaa #xc0) out))
(240 170 192)
[324]> (with-open-file (in "/tmp/bits" :element-type '(unsigned-byte 8))
(loop repeat 24 do (princ (read-bit in))))
000011110101010100000011
NIL
I was expecting: 111100001010101011000000
(Most significant bits in the bytes first).
--
__Pascal Bourguignon__ http://www.informatimago.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d? s++:++ a+ C+++ UL++++ P--- L+++ E+++ W++ N+++ o-- K- w---
O- M++ V PS PE++ Y++ PGP t+ 5+ X++ R !tv b+++ DI++++ D++
G e+++ h+ r-- z?
------END GEEK CODE BLOCK------
.
- Follow-Ups:
- Re: Bits from a stream
- From: Alan Manuel K. Gloria
- Re: Bits from a stream
- References:
- Bits from a stream
- From: Alan Manuel K. Gloria
- Re: Bits from a stream
- From: Zach Beane
- Re: Bits from a stream
- From: Peter Seibel
- Re: Bits from a stream
- From: Alan Manuel K. Gloria
- Re: Bits from a stream
- From: Alan Manuel K. Gloria
- Bits from a stream
- Prev by Date: Re: Graphic-Forms screenshots
- Next by Date: Be CAREFUL about mousing ambidextrously
- Previous by thread: Re: Bits from a stream
- Next by thread: Re: Bits from a stream
- Index(es):