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_BUFFEREDINPUTSTREAM_ 00009 #define _SK_IO_BUFFEREDINPUTSTREAM_ 00010 00011 #include <sk/io/DelegatingInputStream.h> 00012 #include <sk/util/Container.h> 00013 00014 namespace sk { 00015 namespace io { 00016 class BufferedInputStream 00017 : public DelegatingInputStream 00018 { 00019 public: 00020 BufferedInputStream(sk::io::InputStream& stream); 00021 BufferedInputStream(sk::io::InputStream& stream, int size); 00022 virtual ~BufferedInputStream(); 00023 00024 // sk::util::Object re-implementation. 00025 const sk::util::Class getClass() const; 00026 00027 // sk::io::InputStream implementation. 00028 int read(char* buffer, int offset, int size); 00029 using DelegatingInputStream::read; 00030 00031 private: 00032 BufferedInputStream(const BufferedInputStream& other); 00033 BufferedInputStream& operator = (const BufferedInputStream& other); 00034 00035 int _size; 00036 sk::util::Container _container; 00037 }; 00038 } 00039 } 00040 00041 #endif /* _SK_IO_BUFFEREDINPUTSTREAM_ */