00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _DECAF_IO_DATAINPUTSTREAM_H_
00019 #define _DECAF_IO_DATAINPUTSTREAM_H_
00020
00021 #include <decaf/io/FilterInputStream.h>
00022 #include <decaf/io/IOException.h>
00023 #include <decaf/io/EOFException.h>
00024 #include <decaf/io/UTFDataFormatException.h>
00025 #include <decaf/lang/exceptions/NullPointerException.h>
00026 #include <decaf/lang/exceptions/IndexOutOfBoundsException.h>
00027
00028 namespace decaf{
00029 namespace io{
00030
00046 class DECAF_API DataInputStream: public FilterInputStream {
00047 private:
00048
00049
00050
00051 unsigned char buffer[8];
00052
00053 private:
00054
00055 DataInputStream(const DataInputStream&);
00056 DataInputStream& operator=(const DataInputStream&);
00057
00058 public:
00059
00067 DataInputStream(InputStream* inputStream, bool own = false);
00068
00069 virtual ~DataInputStream();
00070
00071 public:
00072
00073
00083 virtual bool readBoolean();
00084
00094 virtual char readByte();
00095
00105 virtual unsigned char readUnsignedByte();
00106
00117 virtual char readChar();
00118
00130 virtual double readDouble();
00131
00143 virtual float readFloat();
00144
00158 virtual int readInt();
00159
00181 virtual long long readLong();
00182
00194 virtual short readShort();
00195
00208 virtual unsigned short readUnsignedShort();
00209
00219 virtual std::string readString();
00220
00240 virtual std::string readLine();
00241
00257 virtual std::string readUTF();
00258
00287 virtual void readFully(unsigned char* buffer, int size);
00288
00320 virtual void readFully(unsigned char* buffer, int size, int offset, int length);
00321
00337 virtual long long skipBytes(long long num);
00338
00339 private:
00340
00341
00342 void readAllData(unsigned char* buffer, int length);
00343
00344 };
00345
00346 }}
00347
00348 #endif