我想转换Integer[]
,但toArray()
正在给我Object[]
。如何将其转换为String[]
?
Stream.of(ids).map(String::valueOf).toArray();
答案 0 :(得分:9)
#define POLY 0x8005
int crc = 0x0000; // Initial value
char data[1024];
int *dp = data;
int fd, nread;
fd = open(argv[1], O_RDWR);
nread = read(fd, data, sizeof(data));
int *end = dp + nread;
while(data < end)
{
crc = crc & 1 && data & 1 ? crc << 1 : (crc << 1) ^ POLY;
data++;
}
答案 1 :(得分:-1)
String[] a= Arrays.toString(array).split("[\\[\\]]")[1].split(", ");
我认为这应该有用