一些数据的转化

 

NSData to Byte[]


int lengthTemp = [input_data length];

Byte *byteData = (Byte*)malloc(lengthTemp);

memcpy(byteData, [input_data bytes], lengthTemp);


Byte[] to NSData


[NSData dataWithBytes: byteData length: sizeof(byteData)];

 

 

http://www.cnblogs.com/upwifi/archive/2011/09/02/2163300.html

你可能感兴趣的:(一些数据的转化)