我需要用Java写这个。
虽然我知道如何读取文件,但我对“buff”输出是什么感兴趣,开头的长度是多少?
char *buff;
unsigned char *aux;
while(fgets (buff+2, length, fin)){
len = strlen (buff + 2) + 2;
aux = (unsigned char *) &len;
buff[1] = aux[0];
buff[0] = aux[1];
...
send (sd, buff, len, 0);
}
但我不明白这一点:
aux = (unsigned char *) &len;
buff[1] = aux[0];
buff[0] = aux[1];
提前致谢。