포럼: 雑談場 (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ファイルでは、形式が異なるのでしょうか?
もしくは、私のデコードの設定などに不備があるのでしょうか?

Reply to #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.) Login

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

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

Reply to #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.) Login

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

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

Reply to #60553

Reply to #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.) Login

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

お世話になります。

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

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


Reply to #60555

Reply to #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.) Login

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

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

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

Reply to #60553

Reply to #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.) Login

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

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

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

そのためにLZMA SDKを使いたいのですが・・・
Reply to #60556

Reply to #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.) Login

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

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

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

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

Reply to #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.) Login