- (uint32_t)intFromData:(NSData *)data useBig:(BOOL)useBig
{
uint32_t result = -1;
if (data == nil) return result;
Byte *bytes = (Byte *)[data bytes];
if (useBig) {//大端模式
result = CFSwapInt32BigToHost(*(int *)bytes);
} else {//小端模式
result = CFSwapInt32LittleToHost(*(int *)bytes);
}
return result;
}