Java 拉链太大了
我正在读取一个文件test1.xlsx,该文件根据Windows具有: 大小:9,71 KB(9 950字节) 磁盘大小:12,0 KB(12 288字节) 但此代码打印的是3183472384,比实际尺寸大得多Java 拉链太大了,java,zip,Java,Zip,我正在读取一个文件test1.xlsx,该文件根据Windows具有: 大小:9,71 KB(9 950字节) 磁盘大小:12,0 KB(12 288字节) 但此代码打印的是3183472384,比实际尺寸大得多 /** * Gets the uncompressed size of this {@code ZipEntry}. * * @return the uncompressed size, or {@code -1} if the size has not been *
/**
* 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;
}
造成这种差异的原因是什么?要么是
ZipEntry.getSize()
不正确,要么是Winders不正确。我怀疑是晚些时候。也许你应该研究一下,在你的问题中加入更多的信息。3MB可能是任何东西,比如一些好的可压缩图像,比如导入的.bmp位图。将xlsx重命名为.zip并手动检查getCompressedSize()
是添加到.xlsx的部分。条目名称是什么?重命名并提取。提取的目录有56,0 KB(57 344字节),您的代码无法编译。真正的代码是什么样子的?它是真正的代码,它取自groovy文件,所以没有分号。我在问题中修正了它。
/**
* 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;
}