diff --git a/include/wx/mstream.h b/include/wx/mstream.h index 0f73867261..3bd53e642d 100644 --- a/include/wx/mstream.h +++ b/include/wx/mstream.h @@ -14,9 +14,13 @@ #include class wxMemoryInputStream: public wxInputStream { + private: + size_t m_length; + public: wxMemoryInputStream(const char *data, size_t length); virtual ~wxMemoryInputStream(); + virtual size_t StreamSize() const { return m_length; } char Peek(); }; diff --git a/src/common/mstream.cpp b/src/common/mstream.cpp index 35e384bade..560c0fd1ae 100644 --- a/src/common/mstream.cpp +++ b/src/common/mstream.cpp @@ -31,7 +31,9 @@ wxMemoryInputStream::wxMemoryInputStream(const char *data, size_t len) : wxInputStream() { m_i_streambuf->SetBufferIO((char*) data, (char*) (data+len)); + m_i_streambuf->SetIntPosition(0); // seek to start pos m_i_streambuf->Fixed(TRUE); + m_length = len; } wxMemoryInputStream::~wxMemoryInputStream()