+size_t wxMemoryOutputStream::OnSysWrite(const void *buffer, size_t nbytes)
+{
+ size_t oldpos = m_o_streambuf->GetIntPosition();
+ m_o_streambuf->Write(buffer, nbytes);
+ size_t newpos = m_o_streambuf->GetIntPosition();
+
+ // FIXME can someone please explain what this does? (VZ)
+ if ( !newpos )
+ newpos = m_o_streambuf->GetBufferSize();
+
+ return newpos - oldpos;
+}
+
+wxFileOffset wxMemoryOutputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode)
+{
+ return m_o_streambuf->Seek(pos, mode);
+}
+
+wxFileOffset wxMemoryOutputStream::OnSysTell() const
+{
+ return m_o_streambuf->Tell();
+}
+
+size_t wxMemoryOutputStream::CopyTo(void *buffer, size_t len) const
+{
+ wxCHECK_MSG( buffer, 0, _T("must have buffer to CopyTo") );
+
+ if ( len > GetSize() )
+ len = GetSize();
+
+ memcpy(buffer, m_o_streambuf->GetBufferStart(), len);
+
+ return len;
+}
+
+#endif // wxUSE_STREAMS