activemq-cpp-3.9.5
InputStreamReader.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_INPUTSTREAMREADER_H_
19#define _DECAF_IO_INPUTSTREAMREADER_H_
20
21#include <decaf/util/Config.h>
22#include <decaf/io/Reader.h>
23
24namespace decaf {
25namespace io {
26
27 class InputStream;
28
42 class DECAF_API InputStreamReader: public Reader {
43 private:
44
45 // The target InputStream
46 InputStream* stream;
47
48 // Does this instance own the InputStream
49 bool own;
50
51 // Has the reader been closed.
52 bool closed;
53
54 private:
55
56 InputStreamReader(const InputStreamReader&);
57 InputStreamReader& operator=(const InputStreamReader&);
58
59 public:
60
71 InputStreamReader(InputStream* stream, bool own = false);
72
74
75 virtual void close();
76
77 virtual bool ready() const;
78
79 protected:
80
81 virtual int doReadArrayBounded(char* buffer, int size, int offset, int length);
82
83 virtual void checkClosed() const;
84
85 };
86
87}}
88
89#endif /* _DECAF_IO_INPUTSTREAMREADER_H_ */
A base class that must be implemented by all classes wishing to provide a class that reads in a strea...
Definition InputStream.h:39
InputStreamReader(InputStream *stream, bool own=false)
Create a new InputStreamReader that wraps the given InputStream.
virtual bool ready() const
Tells whether this stream is ready to be read.
virtual void checkClosed() const
virtual int doReadArrayBounded(char *buffer, int size, int offset, int length)
Override this method to customize the functionality of the method read( unsigned char* buffer,...
virtual void close()
Closes this object and deallocates the appropriate resources.
#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