我已经尝试了几个小时来用 Java 实现这段代码。该代码使用指针,我不知道如何在 Java 中做同样的事情。我试过移位但没有成功。有任何想法吗?
const char bytes[] = {0xa0,0xc7,0xa2,0xbc,0xd4};
NSData *data = [[NSData alloc] initWithBytes:bytes length:5];
uint8_t *byte = (uint8_t*)[data bytes];
uint8_t command = *byte;
byte++;
NSUInteger password = *(uint32_t*)byte;
NSLog(@"password:%u", (uint32_t)password ); // answer: 3569132231