它包含原始(未压缩)输入数据模2 ^ 32的大小。
在gzip.py中,我假设这是您用于gzip支持的内容,其中有一个称为define的方法_read_eof
,如下所示:
def _read_eof(self):
# We've read to the end of the file, so we have to rewind in order
# to reread the 8 bytes containing the CRC and the file size.
# We check the that the computed CRC and size of the
# uncompressed data matches the stored values. Note that the size
# stored is the true file size mod 2**32.
self.fileobj.seek(-8, 1)
crc32 = read32(self.fileobj)
isize = U32(read32(self.fileobj)) # may exceed 2GB
if U32(crc32) != U32(self.crc):
raise IOError, "CRC check Failed"
elif isize != LOWU32(self.size):
raise IOError, "Incorrect length of data produced"
在那里,您可以看到ISIZE
正在读取该字段,但这只是为了将其与self.size
错误检测进行比较。然后,这应意味着GzipFile.size
存储实际的未压缩大小。但是,我认为 它没有公开公开,因此您可能必须破解它才能公开。不太确定,对不起。
我现在只是看了所有这些,而我还没有尝试过,所以我可能是错的。我希望这对您有用。对不起,如果我误解了你的问题。