+ return (m_stream->m_lastcount = orig_size);
+}
+
+size_t wxStreamBuffer::Write(wxStreamBuffer *sbuf)
+{
+ char buf[BUF_TEMP_SIZE];
+ size_t s = 0, bytes_count = BUF_TEMP_SIZE, b_count2;
+ wxInputStream *in_stream;
+
+ if (m_mode == read)
+ return 0;
+
+ in_stream = (wxInputStream *)sbuf->Stream();
+
+ while (bytes_count == BUF_TEMP_SIZE) {
+ b_count2 = sbuf->Read(buf, bytes_count);
+ bytes_count = Write(buf, b_count2);
+ if (b_count2 > bytes_count)
+ in_stream->Ungetch(buf+bytes_count, b_count2-bytes_count);
+ s += bytes_count;
+ }
+ return s;