Shurikn Posted June 8, 2005 Posted June 8, 2005 is there a way to do this? because I am trying to read the header of a swf file and there is a part in it that is never the same length in bits. it use the RECT data format RECT Field Type Comment Nbits: UB[5] //Bits in each rect value field Xmin: SB[Nbits] //x minimum position for rect Xmax: SB[Nbits]// x maximum position for rect Ymin: SB[Nbits] //y minimum position for rect Ymax: SB[Nbits]// y maximum position for rect this come from the macromedia website: http://download.macromedia.com/pub/flash/flash_file_format_specification.pdf since it use a number of bit, I cant just take the byte, and what is worst is that the number of bits varie for the last 4 data depending on the first value, so is ther anyway to use the reader to read 5 bits, then read xbits(the number in the previous reader)4 time or is there any workaround? Quote
Leaders snarfblam Posted June 8, 2005 Leaders Posted June 8, 2005 You will probably have to read bytes and process their individual bits yourself. You might want to consider using something like the System.Collections.Specialized.BitVector32 class, which treats four bytes like an array of 32 bits. If you are lucky, maybe someone can provide you with a class that can handle binary data as an array of bits. Quote [sIGPIC]e[/sIGPIC]
IngisKahn Posted June 8, 2005 Posted June 8, 2005 Writing a BitStream class is no big deal. It took me less than an hour. I'd post it, but I don't own the code. :( But feel free to ask any questions. Quote "Who is John Galt?"
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.