]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/stream.cpp
JPEG handler does not read entire file into memory anymore (+, of course, that header...
[wxWidgets.git] / src / common / stream.cpp
index 5c508e98a23893b4e9a94842a9e37f93a69865d8..2c105915173bbd6ce9a37d7aabbb1b4450b07f83 100644 (file)
@@ -585,11 +585,10 @@ wxInputStream& wxInputStream::Read(void *buffer, size_t size)
     m_lasterror = wxStream_NOERROR;
     return *this;
   }
-  size     -= retsize;
-  buf      += retsize;
+  size -= retsize;
+  buf  += retsize;
 
-  // GRG: shouldn't we also add retsize to m_lastcount here?
-  m_lastcount = OnSysRead(buf, size);
+  m_lastcount = OnSysRead(buf, size) + retsize;
   return *this;
 }
 
@@ -669,6 +668,11 @@ wxOutputStream::~wxOutputStream()
 {
 }
 
+void wxOutputStream::PutC(char c)
+{
+  Write((void *) &c, 1);
+}
+
 wxOutputStream& wxOutputStream::Write(const void *buffer, size_t size)
 {
   m_lastcount = OnSysWrite(buffer, size);
@@ -799,6 +803,9 @@ wxBufferedInputStream::wxBufferedInputStream(wxInputStream& s)
 
 wxBufferedInputStream::~wxBufferedInputStream()
 {
+  off_t unused_bytes=m_i_streambuf->GetBufferPos()-m_i_streambuf->GetBufferEnd();
+  m_parent_i_stream->SeekI(unused_bytes,wxFromCurrent);
+
   delete m_i_streambuf;
 }