我正在阅读根据Windows的文件test1.xlsx:
大小:9,71 KB(9 950字节)
磁盘大小:12,0 KB(12 288字节)
InputStream input = this.getClass().getClassLoader().getResourceAsStream("testData/test1.xlsx");
ZipInputStream test = new ZipInputStream(input);
ZipEntry entry = test.getNextEntry();
System.out.println(entry.getSize());
但是这段代码打印3183472384,比实际尺寸大得多。
/**
* Gets the uncompressed size of this {@code ZipEntry}.
*
* @return the uncompressed size, or {@code -1} if the size has not been
* set.
*/
public long getSize() {
return size;
}
这种差异的原因是什么?