LHA Library for Java

jp.gr.java_conf.dangan.util.lha
Class PreLzsDecoder

java.lang.Object
  extended by jp.gr.java_conf.dangan.util.lha.PreLzsDecoder
All Implemented Interfaces:
PreLzssDecoder

public class PreLzsDecoder
extends java.lang.Object
implements PreLzssDecoder

-lzs- 解凍用 PreLzssDecoder。

 -- revision history --
 $Log: PreLzsDecoder.java,v $
 Revision 1.1  2002/12/06 00:00:00  dangan
 [maintenance]
     ソース整備

 Revision 1.0  2002/08/05 00:00:00  dangan
 add to version control
 [bug fix]
     -lzs- の MaxMatch が 17 であるべきが 16 となっていたのを修正。
 [maintenance]
     ソース整備
     タブ廃止
     ライセンス文の修正

 

Version:
$Revision: 1.1 $
Author:
$Author: dangan $

Constructor Summary
PreLzsDecoder(java.io.InputStream in)
          -lzs- 解凍用 PreLzssDecoder を構築する。
 
Method Summary
 int available()
          ブロックせずに読み出すことの出来る最低バイト数を得る。
InputStream の available() と違い、 この最低バイト数は保証される。
 void close()
          この出力とストリームと 接続されていたストリームを閉じ、 使用していたリソースを解放する。
 int getDictionarySize()
          -lzs-形式の LZSS辞書のサイズを得る。
 int getMaxMatch()
          -lzs-形式の LZSSの最長一致長を得る。
 int getThreshold()
          -lzs-形式の LZSSの圧縮、非圧縮の閾値を得る。
 void mark(int readLimit)
          接続された入力ストリームの現在位置にマークを設定し、 reset() メソッドでマークした時点の 読み込み位置に 戻れるようにする。
InputStream の mark() と違い、readLimit で設定した 限界バイト数より前にマーク位置が無効になる可能性が ある事に注意すること。
 boolean markSupported()
          接続された入力ストリームが mark() と reset() を サポートするかを得る。
 int readCode()
          -lzs- で圧縮された 1byte の LZSS未圧縮のデータ、 もしくは圧縮コードのうち一致長を読み込む。
 int readOffset()
          -lzs- で圧縮された圧縮コードのうち 一致位置を読み込む。
 void reset()
          接続された入力ストリームの読み込み位置を最後に mark() メソッドが呼び出されたときの位置に設定する。
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreLzsDecoder

public PreLzsDecoder(java.io.InputStream in)
-lzs- 解凍用 PreLzssDecoder を構築する。

Parameters:
in - -lzs- 形式の圧縮データを供給する入力ストリーム
Method Detail

readCode

public int readCode()
             throws java.io.IOException
-lzs- で圧縮された 1byte の LZSS未圧縮のデータ、 もしくは圧縮コードのうち一致長を読み込む。

Specified by:
readCode in interface PreLzssDecoder
Returns:
1byte の 未圧縮のデータもしくは、 圧縮された圧縮コードのうち一致長
Throws:
java.io.IOException - 入出力エラーが発生した場合

readOffset

public int readOffset()
               throws java.io.IOException
-lzs- で圧縮された圧縮コードのうち 一致位置を読み込む。

Specified by:
readOffset in interface PreLzssDecoder
Returns:
-lzs- で圧縮された圧縮コードのうち一致位置
Throws:
java.io.IOException - 入出力エラーが発生した場合

mark

public void mark(int readLimit)
接続された入力ストリームの現在位置にマークを設定し、 reset() メソッドでマークした時点の 読み込み位置に 戻れるようにする。
InputStream の mark() と違い、readLimit で設定した 限界バイト数より前にマーク位置が無効になる可能性が ある事に注意すること。

Specified by:
mark in interface PreLzssDecoder
Parameters:
readLimit - マーク位置に戻れる限界のバイト数。 このバイト数を超えてデータを読み 込んだ場合 reset()できなくなる可 能性がある。
See Also:
PreLzssDecoder.mark(int)

reset

public void reset()
           throws java.io.IOException
接続された入力ストリームの読み込み位置を最後に mark() メソッドが呼び出されたときの位置に設定する。

Specified by:
reset in interface PreLzssDecoder
Throws:
java.io.IOException -
   (1) mark() せずに reset() しようとした場合。
   (2) 接続された入力ストリームが markSupported()で false を返す場合。
   (3) 接続された入力ストリームで 入出力エラーが発生した場合。
   の何れか。

markSupported

public boolean markSupported()
接続された入力ストリームが mark() と reset() を サポートするかを得る。

Specified by:
markSupported in interface PreLzssDecoder
Returns:
ストリームが mark() と reset() を サポートする場合は true。
サポートしない場合は false。

available

public int available()
              throws java.io.IOException
ブロックせずに読み出すことの出来る最低バイト数を得る。
InputStream の available() と違い、 この最低バイト数は保証される。

Specified by:
available in interface PreLzssDecoder
Returns:
ブロックしないで読み出せる最低バイト数。
Throws:
java.io.IOException - 入出力エラーが発生した場合
See Also:
PreLzssDecoder.available()

close

public void close()
           throws java.io.IOException
この出力とストリームと 接続されていたストリームを閉じ、 使用していたリソースを解放する。

Specified by:
close in interface PreLzssDecoder
Throws:
java.io.IOException - 入出力エラーが発生した場合

getDictionarySize

public int getDictionarySize()
-lzs-形式の LZSS辞書のサイズを得る。

Specified by:
getDictionarySize in interface PreLzssDecoder
Returns:
-lzs-形式の LZSS辞書のサイズ

getMaxMatch

public int getMaxMatch()
-lzs-形式の LZSSの最長一致長を得る。

Specified by:
getMaxMatch in interface PreLzssDecoder
Returns:
-lzs-形式の LZSSの最長一致長

getThreshold

public int getThreshold()
-lzs-形式の LZSSの圧縮、非圧縮の閾値を得る。

Specified by:
getThreshold in interface PreLzssDecoder
Returns:
-lzs-形式の LZSSの圧縮、非圧縮の閾値

LHA Library for Java

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.