private ByteBuffer mBuffer = ByteBuffer.allocate(1024 * 60);
mBuffer.put(data, beginIndex, remain);
如何在object-c中实现类似的功能
答案 0 :(得分:0)
很抱歉,在Objective-c中没有类似于ByteBuffer的东西,但是您可能会喜欢上一件好事:
NSMutableData *data = [NSMutableData data];
char *pData = {0x1, 0x2, 0x3};
NSData *secondData = [NSData dataWithBytes:pData length:3];
[data appendData:[secondData subdataWithRange:NSMakeRange(1, 2)]];