论坛: 雑談場 (Thread #30827)

7-ZIPでエンコードした7zをLZMA SDKで展開する方法 (2011-11-15 18:50 by orimori #60553)

7zファイルを一括展開するソフトウェアの開発を試みています。
(職場での作業を効率化するためのものであり、商用ソフトではありません)

LZMA SDKのソースコード(ver9.20 Java)でテストしているのですが
うまくいきません。

【テスト】
・1KB程度のtxtファイルの入ったフォルダを
 7-ZIP (9.22 beta)で圧縮し、7zを作成。
・作成した7zファイルをLZMA SDK(LzmaAlone.java)で
 デコードしようとするが、失敗。

【原因】
 600MB以上のメモリ領域が要求され、OutOfMemoryErrorが発生する。
 LzmaAloneを使ったデコードでは、入力ファイル先頭のプロパティ情報に従い
 dictionaryの領域を確保するようになっているが、
 ここに許容不可能な数値が入っている。
(LZMA SDKでエンコした7zは、7-ZIPでもLZMA SDKでもデコードできました)

LZMA SDKでエンコードした7zファイルと
7-ZIPでエンコードした7zファイルでは、形式が異なるのでしょうか?
もしくは、私のデコードの設定などに不備があるのでしょうか?

回复到 #60553×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登录

RE: 7-ZIPでエンコードした7zをLZMA SDKで展開する方法 (2011-11-15 19:10 by orimori #60554)

突然の質問、大変失礼いたしました。
もし、ご存知の方がいらっしゃいましたら、なにとぞよろしくお願いいたします。
回复到 #60553

回复到 #60554×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登录

RE: 7-ZIPでエンコードした7zをLZMA SDKで展開する方法 (2011-11-15 19:35 by 匿名 #60555)

デフォルト辞書サイズはどのような設定になっているでしょうか?
なんとなくそのあたりのような気がします。

回复到 #60553

回复到 #60555×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登录

RE: 7-ZIPでエンコードした7zをLZMA SDKで展開する方法 (2011-11-15 20:05 by orimori #60558)

お世話になります。

>デフォルト辞書サイズはどのような設定になっているでしょうか?
一応、windows環境では-d20に設定していますが、
圧縮時の設定に依存しないデコーダを作りたいと思っています。

それから、メモリ領域を600MB以上使えるLinuxマシンでも
実験してみたのですが、やはり別のところでエラーを出します。


回复到 #60555

回复到 #60558×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登录

RE: 7-ZIPでエンコードした7zをLZMA SDKで展開する方法 (2011-11-15 19:39 by 匿名 #60556)

Windows環境で目的を達成するだけなら、バッチファイルで十分だと思います。
参考:
http://sevenzip.sourceforge.jp/howto/compress-many-files.html

Linux環境で自動化しておきたいということでしたら、p7zipを活用するといいと思います。
http://sourceforge.jp/projects/sfnet_p7zip/

回复到 #60553

回复到 #60556×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登录

RE: 7-ZIPでエンコードした7zをLZMA SDKで展開する方法 (2011-11-15 20:26 by orimori #60559)

すみません。 
こちらの質問が悪かったかと思います。

展開せず圧縮ファイルから、データを抽出したいのです。
すでにzipはそういう仕組みでできていますので、
同じように7zもできないものかと・・・

そのためにLZMA SDKを使いたいのですが・・・
回复到 #60556

回复到 #60559×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登录

RE: 7-ZIPでエンコードした7zをLZMA SDKで展開する方法 (2011-11-16 18:35 by orimori #60579)

調べてみたところLZMA SDKのJavaソースコードは
まだ7zの新しいフォーマットに対応していないみたいです。

ソースコードが7zFormat.txtで定義された形になっていませんし
フォルダの圧縮もできないみたいです。

回答していただいた方、ありがとうございました。
回复到 #60553

回复到 #60579×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登录