bitstreams

Andreas Lobinger andreas.lobinger at netsurf.de
Thu Jul 1 13:59:54 CEST 2004


Aloha,
can anyone here recommend a implementation for bitstreams?

For a project i need to extract bitfields from a file containing
one large bitstream (lenght >> 1000bit). The bitfields (1bit-24bit)
are not aligned to char boundaries (8bit).

Something like
b1 = bitstream.fromfile('m1.bin')
v1 = b1.getbits(startpos=3,length=10) # v ist a reg. int
v2 = b1.getnext(8) # bits 0-7
v3 = b1.getnext(10) # bits 8-17

Hoping for an answer and wishing a happy day
		LOBI






More information about the Python-list mailing list