0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

非圧縮 ZIP(PKZIP) フォーマットのメモ

Posted at

背景

  • 複数ファイルを非圧縮 zip で一つのファイルにまとめたい
  • 非圧縮 zip を, zlib や miniz など使わずに読みたい
  • tar だとちょっとフォーマットがめんどい

仕様

ヘッダは 30 bytes です. compression method が 0 だと非圧縮です.

読み込むときは, central directory に当たったらパース終了と判定すればよいでしょう.

標準では 2GB までのサポートです. 2GB 以上の場合は ZIP64 flag で扱います.

サンプル

cnpy に npz(numpy npy データをまとめたもの. npz は圧縮もサポート) のロードとシリアライズサンプルコードがありますので参考になります.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?