|
LHA Library for Java | ||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||||
java.lang.Objectjava.io.InputStream
jp.gr.java_conf.dangan.util.lha.LhaInputStream
接続されたストリームからLHA書庫データを読みこみ、
エントリを解凍しつつ読み込むためのユーティリティクラス。
java.util.zip.ZipInputStream と似たインターフェイスを持つように作った。
壊れた書庫の処理に関しては壊れたエントリ以降の
壊れていないエントリも正常に読みこめない可能性がある。
-- revision history --
$Log: LhaInputStream.java,v $
Revision 1.1.2.1 2003/07/20 13:22:31 dangan
[bug fix]
getNextEntry() で CompressMethod.connectDecoder に
this.limit を渡すべきところで this.in を渡していた。
Revision 1.1 2002/12/08 00:00:00 dangan
[maintenance]
LhaConstants から CompressMethod へのクラス名の変更に合わせて修正。
Revision 1.0 2002/08/05 00:00:00 dangan
add to version control
[change]
コンストラクタから 引数に String encode を取るものを廃止、
Properties を引数に取るものを追加。
書庫終端に達した場合はそれ以上読み込めないように修正。
available() の振る舞いを java.util.zip.ZipInputStream と同じように
エントリの終端に達していない場合は 1 エントリの終端に達した場合は 0 を返すように変更。
[maintenance]
ソース整備
タブ廃止
ライセンス文の修正
| コンストラクタの概要 | |
LhaInputStream(InputStream in)
in から LHA書庫のデータを読み取る InputStream を構築する。 |
|
LhaInputStream(InputStream in,
Properties property)
in から LHA書庫のデータを読み取る InputStreamを構築する。 |
|
| メソッドの概要 | |
int |
available()
現在読み取り中のエントリの終端に達したかを得る。 |
void |
close()
この入力ストリームを閉じ、使用していた 全てのリソースを開放する。 |
void |
closeEntry()
現在読み取り中のエントリを閉じ、 次のエントリを読みこめるようにストリームを設定する。 |
LhaHeader |
getNextEntry()
次のエントリを解凍しながら読みこむようにストリームを設定する。 |
LhaHeader |
getNextEntryWithoutExtract()
次のエントリを解凍しないで読みこむようにストリームを設定する。 |
void |
mark(int readLimit)
現在読み取り中のエントリの現在位置にマークを設定し、 reset() でマークした読み込み位置に戻れるようにする。 |
boolean |
markSupported()
接続された入力ストリームが mark()と reset()をサポートするかを得る。 |
int |
read()
現在のエントリから 1バイトのデータを読み込む。 |
int |
read(byte[] buffer)
現在のエントリから buffer を満たすようにデータを読み込む。 |
int |
read(byte[] buffer,
int index,
int length)
現在のエントリから buffer のindexへ lengthバイトの データをを読み込む。 |
void |
reset()
現在読み取り中のエントリの読み込み位置を最後に mark() メソッドが呼び出されたときの位置に設定する。 |
long |
skip(long length)
現在のエントリのデータを length バイト読みとばす。 |
| クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| コンストラクタの詳細 |
public LhaInputStream(InputStream in)
in - LHA書庫形式のデータを供給する入力ストリームLhaProperty.getProperties()
public LhaInputStream(InputStream in,
Properties property)
throws UnsupportedEncodingException
in - LHA書庫形式のデータを供給する入力ストリームproperty - 各圧縮形式に対応した復号器の生成式等が含まれるプロパティ
UnsupportedEncodingException - property.getProperty( "lha.encoding" ) で得られた
エンコーディング名がサポートされない場合| メソッドの詳細 |
public int read()
throws IOException
IOException - 現在読み込み中のエントリが無いか
入出力エラーが発生した場合
public int read(byte[] buffer)
throws IOException
buffer - データを読み込むバッファ
IOException - 現在読み込み中のエントリが無いか
入出力エラーが発生した場合
public int read(byte[] buffer,
int index,
int length)
throws IOException
buffer - データを読み込むバッファindex - buffer内のデータ読み込み開始位置length - 読み込むデータ量
IOException - 現在読み込み中のエントリが無いか
入出力エラーが発生した場合
public long skip(long length)
throws IOException
length - 読みとばすデータ量
IOException - 現在読み込み中のエントリが無いか
入出力エラーが発生した場合public void mark(int readLimit)
readLimit - マーク位置に戻れる限界読み込み量。
このバイト数を超えてデータを読み込んだ場合
reset() できる保証はない。
IllegalStateException - 現在読み込み中のエントリが無い場合
public void reset()
throws IOException
IOException - 現在読み込み中のエントリが無いか
入出力エラーが発生した場合public boolean markSupported()
public int available()
throws IOException
IOException - 現在読み込み中のエントリが無いか
入出力エラーが発生した場合ZipInputStream.available()
public void close()
throws IOException
IOException - 入出力エラーが発生した場合
public LhaHeader getNextEntry()
throws IOException
IOException - 入出力エラーが発生した場合
public LhaHeader getNextEntryWithoutExtract()
throws IOException
IOException - 入出力エラーが発生した場合
public void closeEntry()
throws IOException
IOException - 入出力エラーが発生した場合
|
LHA Library for Java | ||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||||