resource_sizes.py 文件源码

python
阅读 14 收藏 0 点赞 0 评论 0

项目:gn_build 作者: realcome 项目源码 文件源码
def _CalculateCompressedSize(file_path):
  CHUNK_SIZE = 256 * 1024
  compressor = zlib.compressobj()
  total_size = 0
  with open(file_path, 'rb') as f:
    for chunk in iter(lambda: f.read(CHUNK_SIZE), ''):
      total_size += len(compressor.compress(chunk))
  total_size += len(compressor.flush())
  return total_size
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号