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_DELEGATINGINPUTSTREAM_ 00009 #define _SK_IO_DELEGATINGINPUTSTREAM_ 00010 00011 #include <sk/io/AbstractInputStream.h> 00012 00013 namespace sk { 00014 namespace io { 00015 class DelegatingInputStream 00016 : public virtual sk::io::AbstractInputStream 00017 { 00018 public: 00019 DelegatingInputStream(sk::io::InputStream& stream); 00020 virtual ~DelegatingInputStream(); 00021 00022 sk::io::InputStream& getInputStream() const; 00023 00024 // sk::util::Object re-implementation. 00025 const sk::util::Class getClass() const; 00026 00027 // sk::io::InputStream implementation. 00028 void close(); 00029 int skip(int number); 00030 long long available() const; 00031 bool markSupported() const; 00032 void mark(int readlimit); 00033 void reset(); 00034 int read(char* buffer, int offset, int length); 00035 using AbstractInputStream::read; 00036 00037 private: 00038 DelegatingInputStream(const DelegatingInputStream& other); 00039 DelegatingInputStream& operator = (const DelegatingInputStream& other); 00040 00041 sk::io::InputStream& _stream; 00042 }; 00043 } 00044 } 00045 00046 #endif /* _SK_IO_DELEGATINGINPUTSTREAM_ */