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_DATAOUTPUTSTREAM_ 00009 #define _SK_IO_DATAOUTPUTSTREAM_ 00010 00011 #include <sk/io/DelegatingOutputStream.h> 00012 #include <sk/io/DataOutput.h> 00013 00014 namespace sk { 00015 namespace io { 00016 class DataOutputStream 00017 : public DelegatingOutputStream, 00018 public virtual sk::io::DataOutput 00019 { 00020 public: 00021 DataOutputStream(sk::io::OutputStream& stream); 00022 virtual ~DataOutputStream(); 00023 00024 // sk::util::Object re-implementation. 00025 const sk::util::Class getClass() const; 00026 00027 void writeInt(int value); 00028 void writeLong(long long value); 00029 void writeShort(short value); 00030 void writeDouble(double value); 00031 void writeFloat(float value); 00032 void writeChar(char value); 00033 void writeChars(const std::string& value); 00034 void writeFully(const std::vector<char>& value); 00035 private: 00036 DataOutputStream(const DataOutputStream& other); 00037 DataOutputStream& operator = (const DataOutputStream& other); 00038 00039 void writeFully(const char* buffer, int length); 00040 }; 00041 } 00042 } 00043 00044 #endif /* _SK_IO_DATAOUTPUTSTREAM_ */