activemq-cpp-3.9.5
DataInput.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_DATAINPUT_H_
19#define _DECAF_IO_DATAINPUT_H_
20
21#include <decaf/util/Config.h>
22
23#include <vector>
24#include <string>
25
31
32namespace decaf {
33namespace io {
34
52 public:
53
54 virtual ~DataInput();
55
65 virtual bool readBoolean() = 0;
66
76 virtual char readByte() = 0;
77
87 virtual unsigned char readUnsignedByte() = 0;
88
99 virtual char readChar() = 0;
100
112 virtual double readDouble() = 0;
113
125 virtual float readFloat() = 0;
126
140 virtual int readInt() = 0;
141
163 virtual long long readLong() = 0;
164
176 virtual short readShort() = 0;
177
190 virtual unsigned short readUnsignedShort() = 0;
191
201 virtual std::string readString() = 0;
202
222 virtual std::string readLine() = 0;
223
239 virtual std::string readUTF() = 0;
240
269 virtual void readFully(unsigned char* buffer, int size) = 0;
270
302 virtual void readFully(unsigned char* buffer, int size, int offset, int length) = 0;
303
319 virtual long long skipBytes(long long num) = 0;
320
321 };
322
323}}
324
325#endif /* _DECAF_IO_DATAINPUT_H_ */
The DataInput interface provides for reading bytes from a binary stream and reconstructing from them ...
Definition DataInput.h:51
virtual long long skipBytes(long long num)=0
Makes an attempt to skip over n bytes of data from the input stream, discarding the skipped bytes.
virtual char readChar()=0
Reads an input char and returns the char value.
virtual char readByte()=0
Reads and returns one input byte.
virtual long long readLong()=0
Reads eight input bytes and returns a long value.
virtual unsigned char readUnsignedByte()=0
Reads one input byte, zero-extends it to type int, and returns the result, which is therefore in the ...
virtual int readInt()=0
Reads four input bytes and returns an int value.
virtual bool readBoolean()=0
Reads in one byte and returns true if that byte is nonzero, false if that byte is zero.
virtual std::string readString()=0
Reads an NULL terminated ASCII string to the stream and returns the string to the caller.
virtual unsigned short readUnsignedShort()=0
Reads two input bytes and returns an int value in the range 0 through 65535.
virtual double readDouble()=0
Reads eight input bytes and returns a double value.
virtual std::string readUTF()=0
Reads a modified UTF-8 encoded string in ASCII format and returns it, this is only useful if you know...
virtual short readShort()=0
Reads two input bytes and returns a short value.
virtual void readFully(unsigned char *buffer, int size)=0
Reads some bytes from an input stream and stores them into the buffer array buffer.
virtual float readFloat()=0
Reads four input bytes and returns a float value.
virtual std::string readLine()=0
Reads the next line of text from the input stream.
virtual void readFully(unsigned char *buffer, int size, int offset, int length)=0
Reads length bytes from an input stream.
#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