我有奇怪的问题
服务器发送功能
-(void) writeToServer:(const uint8_t *) buf {
NSLog(@"sending buf %s with lenght %zd", buf, strlen((char*)buf));
[oStream write:buf maxLength:strlen((char*)buf)];
// NSOutputStream *oStream
}
buf
是
NSLog(@"converted %@ length %d", encrypted, [encrypted length]);
// encrypted is NSMutableData
return (const uint8_t*)[encrypted bytes];
输出
converted <4b010000 00000006 00000000 00000f20 30303031 4e50> length 22
sending buf K with lenght 2
我需要 buf 保持不变.. 具有相同的原始字节和适当的长度,我应该怎么做?