read64(void)1 uint64_t asfPacket::read64(void) 2 { 3 uint64_t lo,hi; 4 lo=read32(); 5 hi=read32(); 6 _offset+=8; 7 ADM_assert(_offset<=pakSize); 8 return lo+(hi<<32); 9 10 } read32(void)11 uint32_t asfPacket::read32(void) 12 { 13 uint8_t c[4]; 14 fread(c,4,1,_fd); 15 _offset+=4; 16 ADM_assert(_offset<=pakSize); 17 return c[0]+(c[1]<<8)+(c[2]<<16)+(c[3]<<24); 18 } read16(void)19 uint32_t asfPacket::read16(void) 20 { 21 uint8_t c[2]; 22 fread(c,2,1,_fd); 23 _offset+=2; 24 ADM_assert(_offset<=pakSize); 25 return c[0]+(c[1]<<8); 26 } 27 read8(void)28 uint8_t asfPacket::read8(void) 29 { 30 uint8_t c[1]; 31 fread(c,1,1,_fd); 32 _offset++; 33 ADM_assert(_offset<=pakSize); 34 return c[0]; 35 } 36