00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _DECAF_UTIL_ZIP_INFLATERINPUTSTREAM_H_
00019 #define _DECAF_UTIL_ZIP_INFLATERINPUTSTREAM_H_
00020
00021 #include <decaf/util/Config.h>
00022
00023 #include <decaf/io/FilterInputStream.h>
00024 #include <decaf/io/IOException.h>
00025 #include <decaf/util/zip/Inflater.h>
00026
00027 #include <vector>
00028
00029 namespace decaf {
00030 namespace util {
00031 namespace zip {
00032
00038 class DECAF_API InflaterInputStream : public decaf::io::FilterInputStream {
00039 protected:
00040
00044 Inflater* inflater;
00045
00049 std::vector<unsigned char> buff;
00050
00054 int length;
00055
00056 bool ownInflater;
00057 bool atEOF;
00058
00059 static const int DEFAULT_BUFFER_SIZE;
00060
00061 private:
00062
00063 InflaterInputStream( const InflaterInputStream& );
00064 InflaterInputStream& operator= ( const InflaterInputStream& );
00065
00066 public:
00067
00076 InflaterInputStream( decaf::io::InputStream* inputStream, bool own = false );
00077
00095 InflaterInputStream( decaf::io::InputStream* inputStream, Inflater* inflater,
00096 bool own = false, bool ownInflater = false );
00097
00118 InflaterInputStream( decaf::io::InputStream* inputStream, Inflater* inflater,
00119 int bufferSize, bool own = false, bool ownInflater = false );
00120
00121 virtual ~InflaterInputStream();
00122
00128 virtual int available() const;
00129
00135 virtual void close();
00136
00142 virtual long long skip( long long num );
00143
00149 virtual void mark( int readLimit );
00150
00156 virtual void reset();
00157
00163 virtual bool markSupported() const;
00164
00165 protected:
00166
00172 virtual void fill();
00173
00174 protected:
00175
00176 virtual int doReadByte();
00177
00178 virtual int doReadArrayBounded( unsigned char* buffer, int size, int offset, int length );
00179
00180 };
00181
00182 }}}
00183
00184 #endif