I am trying to read the header of an SWF file using NSData. According to SWF format specification I need to access movie's width and height reading bits, not bytes, and I couldn't find a way to do it in Obj-C
Bytes 9 thru ?: Here is stored a RECT (bounds of movie). It must be read in binary form. First of all, we will transform the first byte to binary: "01100000" The first 5 bits will tell us the size in bits of each stored value: "01100" = 12 So, we have 4 fields of 12 bits = 48 bits 48 bits + 5 bits (header of RECT) = 53 bits Fill to complete bytes with zeroes, till we reach a multiple of 8. 53 bits + 3 alignment bits = 56 bits (this RECT is 7 bytes length, 7 * 8 = 56) I use this formula to determine all this stuff:
Where do I start?