activemq-cpp-3.8.2
InflaterInputStream.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _DECAF_UTIL_ZIP_INFLATERINPUTSTREAM_H_
19 #define _DECAF_UTIL_ZIP_INFLATERINPUTSTREAM_H_
20 
21 #include <decaf/util/Config.h>
22 
24 #include <decaf/io/IOException.h>
26 
27 #include <vector>
28 
29 namespace decaf {
30 namespace util {
31 namespace zip {
32 
39  protected:
40 
45 
49  std::vector<unsigned char> buff;
50 
54  int length;
55 
57  bool atEOF;
58 
59  static const int DEFAULT_BUFFER_SIZE;
60 
61  private:
62 
64  InflaterInputStream& operator= ( const InflaterInputStream& );
65 
66  public:
67 
76  InflaterInputStream( decaf::io::InputStream* inputStream, bool own = false );
77 
95  InflaterInputStream( decaf::io::InputStream* inputStream, Inflater* inflater,
96  bool own = false, bool ownInflater = false );
97 
118  InflaterInputStream( decaf::io::InputStream* inputStream, Inflater* inflater,
119  int bufferSize, bool own = false, bool ownInflater = false );
120 
121  virtual ~InflaterInputStream();
122 
128  virtual int available() const;
129 
135  virtual void close();
136 
142  virtual long long skip( long long num );
143 
149  virtual void mark( int readLimit );
150 
156  virtual void reset();
157 
163  virtual bool markSupported() const;
164 
165  protected:
166 
172  virtual void fill();
173 
174  protected:
175 
176  virtual int doReadByte();
177 
178  virtual int doReadArrayBounded( unsigned char* buffer, int size, int offset, int length );
179 
180  };
181 
182 }}}
183 
184 #endif /* _DECAF_UTIL_ZIP_INFLATERINPUTSTREAM_H_ */
bool ownInflater
Definition: InflaterInputStream.h:56
int length
The amount of data currently stored in the input buffer.
Definition: InflaterInputStream.h:54
Inflater * inflater
The Inflater instance to use.
Definition: InflaterInputStream.h:44
A base class that must be implemented by all classes wishing to provide a class that reads in a strea...
Definition: InputStream.h:39
bool atEOF
Definition: InflaterInputStream.h:57
A FilterInputStream that decompresses data read from the wrapped InputStream instance.
Definition: InflaterInputStream.h:38
std::vector< unsigned char > buff
The buffer to hold chunks of data read from the stream before inflation.
Definition: InflaterInputStream.h:49
A FilterInputStream contains some other input stream, which it uses as its basic source of data...
Definition: FilterInputStream.h:38
#define DECAF_API
Definition: Config.h:29
static const int DEFAULT_BUFFER_SIZE
Definition: InflaterInputStream.h:59
This class uncompresses data that was compressed using the DEFLATE algorithm (see specification)...
Definition: Inflater.h:54
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: AprPool.h:25