activemq-cpp-3.9.5
FilterInputStream.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_IO_FILTERINPUTSTREAM_H_
19#define _DECAF_IO_FILTERINPUTSTREAM_H_
20
25
26namespace decaf{
27namespace io{
28
38 class DECAF_API FilterInputStream: public InputStream {
39 protected:
40
41 // The input stream to wrap
42 InputStream* inputStream;
43
44 // Indicates if we own the wrapped stream
45 bool own;
46
47 // Indicates that this stream was closed
48 volatile bool closed;
49
50 private:
51
52 FilterInputStream(const FilterInputStream&);
53 FilterInputStream& operator=(const FilterInputStream&);
54
55 public:
56
65 FilterInputStream(InputStream* inputStream, bool own = false);
66
68
72 virtual int available() const;
73
77 virtual void close();
78
82 virtual long long skip(long long num);
83
87 virtual void mark(int readLimit);
88
92 virtual void reset();
93
97 virtual bool markSupported() const;
98
99 protected:
100
101 virtual int doReadByte();
102
103 virtual int doReadArray(unsigned char* buffer, int size);
104
105 virtual int doReadArrayBounded(unsigned char* buffer, int size, int offset, int length);
106
110 virtual bool isClosed() const;
111
112 };
113
114}}
115
116#endif /*_DECAF_IO_FILTERINPUTSTREAM_H_*/
virtual int available() const
Indicates the number of bytes available.The default implementation of this methods returns 0....
virtual int doReadArray(unsigned char *buffer, int size)
virtual long long skip(long long num)
Skips over and discards n bytes of data from this input stream.The skip method may,...
virtual void reset()
Repositions this stream to the position at the time the mark method was last called on this input str...
bool own
Definition FilterInputStream.h:45
volatile bool closed
Definition FilterInputStream.h:48
virtual void mark(int readLimit)
Marks the current position in the stream A subsequent call to the reset method repositions this strea...
virtual int doReadArrayBounded(unsigned char *buffer, int size, int offset, int length)
InputStream * inputStream
Definition FilterInputStream.h:42
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...
virtual bool isClosed() const
FilterInputStream(InputStream *inputStream, bool own=false)
Constructor to create a wrapped InputStream.
#define DECAF_API
Definition Config.h:29
Definition BlockingByteArrayInputStream.h:25
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25