Chinaunix首页 | 论坛 | 博客
  • 博客访问: 871207
  • 博文数量: 322
  • 博客积分: 6688
  • 博客等级: 准将
  • 技术积分: 3626
  • 用 户 组: 普通用户
  • 注册时间: 2010-09-19 11:26
文章分类

全部博文(322)

文章存档

2013年(5)

2012年(66)

2011年(87)

2010年(164)

分类: BSD

2012-02-13 12:07:43

  1.         int num = 160;

  2.         SignedByte sb = (SignedByte)num;

  3.         Byte b = (Byte)num;

  4.         NSLog(@"b is %d,sb is %d",b,sb);

  5.         Byte arr[4];

  6.         for(int i=0; i<4; i++){

  7.             arr[i] = num >> 24 - 8*i & 0xff;

  8.         }

  9.         NSData *data = [NSData dataWithBytes:&arr length:4];

  10.         Byte *aa = (Byte *)[data bytes];

  11.         for(int a=0; a<[data length]; a++){

  12.             NSLog(@"aa[%d] is %d",a,aa[a]);

  13.         }

阅读(1830) | 评论(0) | 转发(0) |
0

上一篇:Note iOS 1

下一篇:convet NSData to Byte*

给主人留下些什么吧!~~