00001 /* Copyright (c) 2006, Gennady Bystritsky <bystr@mac.com> 00002 * 00003 * Distributed under the MIT Licence. 00004 * This is free software. See 'LICENSE' for details. 00005 * You must read and accept the license prior to use. 00006 */ 00007 00008 #ifndef _SK_IO_DATAINPUTSTREAM_ 00009 #define _SK_IO_DATAINPUTSTREAM_ 00010 00011 #include <sk/io/DelegatingInputStream.h> 00012 #include <sk/io/DataInput.h> 00013 00014 namespace sk { 00015 namespace io { 00016 class DataInputStream 00017 : public sk::io::DelegatingInputStream, 00018 public virtual sk::io::DataInput 00019 { 00020 public: 00021 DataInputStream(sk::io::InputStream& stream); 00022 virtual ~DataInputStream(); 00023 00024 // sk::util::Object re-implementation. 00025 const sk::util::Class getClass() const; 00026 00027 // sk::io::DataInput implementation. 00028 int readInt(); 00029 long long readLong(); 00030 short readShort(); 00031 char readChar(); 00032 double readDouble(); 00033 float readFloat(); 00034 int skipBytes(int number); 00035 const sk::util::String readLine(); 00036 std::vector<char>& readFully(std::vector<char>& buffer, int number); 00037 std::vector<char> readFully(int number); 00038 00039 private: 00040 DataInputStream(const DataInputStream& other); 00041 DataInputStream& operator = (const DataInputStream& other); 00042 00043 void readFully(char* buffer, int length); 00044 }; 00045 } 00046 } 00047 00048 #endif /* _SK_IO_DATAINPUTSTREAM_ */