Added tests for buffered streams.

Made wxBufferedOutputStream call Sync() in
    the destructor and SeekO().
  Documented this.
  Use buffered streams in wxImage. Seems to
    significantly speed-up the sample.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4847 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-12-06 18:16:37 +00:00
parent 85d11a7072
commit 1b055864b6
5 changed files with 125 additions and 6 deletions

View File

@@ -381,7 +381,8 @@ bool wxImage::LoadFile( const wxString& filename, long type )
if (wxFileExists(filename))
{
wxFileInputStream stream(filename);
return LoadFile(stream, type);
wxBufferedInputStream bstream( stream );
return LoadFile(bstream, type);
}
else
{
@@ -400,7 +401,8 @@ bool wxImage::LoadFile( const wxString& filename, const wxString& mimetype )
if (wxFileExists(filename))
{
wxFileInputStream stream(filename);
return LoadFile(stream, mimetype);
wxBufferedInputStream bstream( stream );
return LoadFile(bstream, mimetype);
}
else
{
@@ -419,7 +421,10 @@ bool wxImage::SaveFile( const wxString& filename, int type )
wxFileOutputStream stream(filename);
if ( stream.LastError() == wxStream_NOERROR )
return SaveFile(stream, type);
{
wxBufferedOutputStream bstream( stream );
return SaveFile(bstream, type);
}
else
#endif // wxUSE_STREAMS
return FALSE;
@@ -431,7 +436,10 @@ bool wxImage::SaveFile( const wxString& filename, const wxString& mimetype )
wxFileOutputStream stream(filename);
if ( stream.LastError() == wxStream_NOERROR )
return SaveFile(stream, mimetype);
{
wxBufferedOutputStream bstream( stream );
return SaveFile(bstream, mimetype);
}
else
#endif // wxUSE_STREAMS
return FALSE;