public class LhaInputStream
extends java.io.InputStream
-- 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] ソース整備 タブ廃止 ライセンス文の修正
Constructor and Description |
---|
LhaInputStream(java.io.InputStream in)
in から LHA書庫のデータを読み取る InputStream を構築する。
各圧縮形式に対応した復号器の生成式等を持つプロパティには LhaProperty.getProperties() で得られたプロパティが使用される。 |
LhaInputStream(java.io.InputStream in,
java.util.Properties property)
in から LHA書庫のデータを読み取る InputStreamを構築する。
|
Modifier and Type | Method and Description |
---|---|
int |
available()
現在読み取り中のエントリの終端に達したかを得る。
ブロックしないで読み込めるデータ量を返さない事に注意すること。 |
void |
close()
この入力ストリームを閉じ、使用していた
全てのリソースを開放する。
|
void |
closeEntry()
現在読み取り中のエントリを閉じ、
次のエントリを読みこめるようにストリームを設定する。
|
LhaHeader |
getNextEntry()
次のエントリを解凍しながら読みこむようにストリームを設定する。
|
LhaHeader |
getNextEntryWithoutExtract()
次のエントリを解凍しないで読みこむようにストリームを設定する。
|
void |
mark(int readLimit)
現在読み取り中のエントリの現在位置にマークを設定し、
reset() でマークした読み込み位置に戻れるようにする。
|
boolean |
markSupported()
接続された入力ストリームが mark()と
reset()をサポートするかを得る。
ヘッダ読み込み時に mark/reset が必須のため コンストラクタで渡された in が markSupported() で false を返す場合、このクラスは in を mark/reset をサポートする BufferedInputStream でラップする。 そのため、このメソッドは常に true を返す。 |
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 バイト読みとばす。
|
public LhaInputStream(java.io.InputStream in)
in
- LHA書庫形式のデータを供給する入力ストリームLhaProperty.getProperties()
public LhaInputStream(java.io.InputStream in, java.util.Properties property) throws java.io.UnsupportedEncodingException
in
- LHA書庫形式のデータを供給する入力ストリームproperty
- 各圧縮形式に対応した復号器の生成式等が含まれるプロパティjava.io.UnsupportedEncodingException
- property.getProperty( "lha.encoding" ) で得られた
エンコーディング名がサポートされない場合public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
- 現在読み込み中のエントリが無いか
入出力エラーが発生した場合public int read(byte[] buffer) throws java.io.IOException
read
in class java.io.InputStream
buffer
- データを読み込むバッファjava.io.IOException
- 現在読み込み中のエントリが無いか
入出力エラーが発生した場合public int read(byte[] buffer, int index, int length) throws java.io.IOException
read
in class java.io.InputStream
buffer
- データを読み込むバッファindex
- buffer内のデータ読み込み開始位置length
- 読み込むデータ量java.io.IOException
- 現在読み込み中のエントリが無いか
入出力エラーが発生した場合public long skip(long length) throws java.io.IOException
skip
in class java.io.InputStream
length
- 読みとばすデータ量java.io.IOException
- 現在読み込み中のエントリが無いか
入出力エラーが発生した場合public void mark(int readLimit)
mark
in class java.io.InputStream
readLimit
- マーク位置に戻れる限界読み込み量。
このバイト数を超えてデータを読み込んだ場合
reset() できる保証はない。java.lang.IllegalStateException
- 現在読み込み中のエントリが無い場合public void reset() throws java.io.IOException
reset
in class java.io.InputStream
java.io.IOException
- 現在読み込み中のエントリが無いか
入出力エラーが発生した場合public boolean markSupported()
markSupported
in class java.io.InputStream
public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
- 現在読み込み中のエントリが無いか
入出力エラーが発生した場合ZipInputStream.available()
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
- 入出力エラーが発生した場合public LhaHeader getNextEntry() throws java.io.IOException
java.io.IOException
- 入出力エラーが発生した場合public LhaHeader getNextEntryWithoutExtract() throws java.io.IOException
java.io.IOException
- 入出力エラーが発生した場合public void closeEntry() throws java.io.IOException
java.io.IOException
- 入出力エラーが発生した場合
When you found typographical errors or omissions, Please mail to cqw10305@nifty.com
The company name and product name which are used in this document, it is the trademark or registered trademark of each company generally.
Copyright © 2001-2002 Michel Ishizuka. All Rights Reserved.