activemq-cpp-3.9.5
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
26
27#include <vector>
28
29namespace decaf {
30namespace util {
31namespace zip {
32
38 class DECAF_API InflaterInputStream : public decaf::io::FilterInputStream {
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
63 InflaterInputStream(const InflaterInputStream&);
64 InflaterInputStream& operator=(const InflaterInputStream&);
65
66 public:
67
77
96 bool own = false, bool ownInflater = false);
97
119 int bufferSize, bool own = false, bool ownInflater = false);
120
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_ */
A FilterInputStream contains some other input stream, which it uses as its basic source of data,...
Definition FilterInputStream.h:38
bool own
Definition FilterInputStream.h:45
InputStream * inputStream
Definition FilterInputStream.h:42
A base class that must be implemented by all classes wishing to provide a class that reads in a strea...
Definition InputStream.h:39
This class uncompresses data that was compressed using the DEFLATE algorithm (see specification).
Definition Inflater.h:54
InflaterInputStream(decaf::io::InputStream *inputStream, bool own=false)
Create an instance of this class with a default inflater and buffer size.
std::vector< unsigned char > buff
The buffer to hold chunks of data read from the stream before inflation.
Definition InflaterInputStream.h:49
InflaterInputStream(decaf::io::InputStream *inputStream, Inflater *inflater, int bufferSize, bool own=false, bool ownInflater=false)
Creates a new DeflateOutputStream with a user supplied Inflater and specified buffer size.
virtual int doReadArrayBounded(unsigned char *buffer, int size, int offset, int length)
bool ownInflater
Definition InflaterInputStream.h:56
InflaterInputStream(decaf::io::InputStream *inputStream, Inflater *inflater, bool own=false, bool ownInflater=false)
Creates a new InflaterInputStream with a user supplied Inflater and a default buffer size.
virtual void close()
Closes the InputStream freeing any resources that might have been acquired during the lifetime of thi...
virtual bool markSupported() const
Determines if this input stream supports the mark and reset methods.Whether or not mark and reset are...
Inflater * inflater
The Inflater instance to use.
Definition InflaterInputStream.h:44
virtual void reset()
Repositions this stream to the position at the time the mark method was last called on this input str...
static const int DEFAULT_BUFFER_SIZE
Definition InflaterInputStream.h:59
virtual void mark(int readLimit)
Marks the current position in the stream A subsequent call to the reset method repositions this strea...
bool atEOF
Definition InflaterInputStream.h:57
virtual void fill()
Fills the input buffer with the next chunk of data.
virtual long long skip(long long num)
Skips over and discards n bytes of data from this input stream.The skip method may,...
virtual int available() const
Indicates the number of bytes available.The default implementation of this methods returns 0....
int length
The amount of data currently stored in the input buffer.
Definition InflaterInputStream.h:54
#define DECAF_API
Definition Config.h:29
Definition Adler32.h:26
Definition AbstractCollection.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25