activemq-cpp-3.8.2
DataInputStream.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_DATAINPUTSTREAM_H_
19 #define _DECAF_IO_DATAINPUTSTREAM_H_
20 
22 #include <decaf/io/IOException.h>
23 #include <decaf/io/EOFException.h>
27 
28 namespace decaf{
29 namespace io{
30 
47  private:
48 
49  // Buffer used to store bytes read from the stream while reconstructed into
50  // higher order C++ primitives.
51  unsigned char buffer[8];
52 
53  private:
54 
56  DataInputStream& operator=(const DataInputStream&);
57 
58  public:
59 
67  DataInputStream(InputStream* inputStream, bool own = false);
68 
69  virtual ~DataInputStream();
70 
71  public:
72  // DataInput
73 
83  virtual bool readBoolean();
84 
94  virtual char readByte();
95 
105  virtual unsigned char readUnsignedByte();
106 
117  virtual char readChar();
118 
130  virtual double readDouble();
131 
143  virtual float readFloat();
144 
158  virtual int readInt();
159 
181  virtual long long readLong();
182 
194  virtual short readShort();
195 
208  virtual unsigned short readUnsignedShort();
209 
219  virtual std::string readString();
220 
240  virtual std::string readLine();
241 
257  virtual std::string readUTF();
258 
287  virtual void readFully(unsigned char* buffer, int size);
288 
320  virtual void readFully(unsigned char* buffer, int size, int offset, int length);
321 
337  virtual long long skipBytes(long long num);
338 
339  private:
340 
341  // Used internally to reliably get data from the underlying stream
342  void readAllData(unsigned char* buffer, int length);
343 
344  };
345 
346 }}
347 
348 #endif /*_DECAF_IO_DATAINPUTSTREAM_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
A data input stream lets an application read primitive Java data types from an underlying input strea...
Definition: DataInputStream.h:46
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
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: AprPool.h:25