处理TCP DUMP的时候 FileInputStream file = new FileInputStream(path1);
this.output = new BufferedWriter(new FileWriter(path2));
DataInputStream dis = new DataInputStream(file); for (int t = 0; t < 4; t++) {
if ((c = dis.read()) != -1) {
result = intToByteArray(c, 1);
temp = temp + getHex(result);
i++;
} else
return (0);
}总是提前就Return了 而且还每次都同一个位置停止
文件越大丢的越多
this.output = new BufferedWriter(new FileWriter(path2));
DataInputStream dis = new DataInputStream(file); for (int t = 0; t < 4; t++) {
if ((c = dis.read()) != -1) {
result = intToByteArray(c, 1);
temp = temp + getHex(result);
i++;
} else
return (0);
}总是提前就Return了 而且还每次都同一个位置停止
文件越大丢的越多
if ((c = dis.read()) != -1) {
result = intToByteArray(c, 1);
temp = temp + getHex(result);
i++;
} else
return (0);
}
这里只进行4次循环
试试while(true){
if ((c = dis.read()) != -1) {
result = intToByteArray(c, 1);
temp = temp + getHex(result);
i++;
} else
return (0);
}
试试看
if ((c = dis.read()) != -1) {
result = intToByteArray(c, 1);
temp = temp + getHex(result);
i++;
} else
return (0);
}
这里只进行4次循环
试试while(true){
if ((c = dis.read()) != -1) {
result = intToByteArray(c, 1);
temp = temp + getHex(result);
i++;
} else
return (0);
}
试试看
4这个后面还有一个大循环的
主要是dis.read()无故返回-1...