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

@@ -28,8 +28,9 @@ from (such as a file stream or a memory stream).
This stream acts as a cache. It caches the bytes to be written to the specified
output stream (See \helpref{wxFilterOutputStream}{wxfilteroutputstream}). The
datas are only written when the cache is full or when the buffered stream is
destroyed.
datas are only written when the cache is full, when the buffered stream is
destroyed or when calling SeekO().
This class may not be used without some other stream to write the data
to (such as a file stream or a memory stream).
@@ -45,3 +46,35 @@ to (such as a file stream or a memory stream).
\helpref{wxStreamBuffer}{wxstreamBuffer}, \helpref{wxOutputStream}{wxoutputstream}
% ----------
% Members
% ----------
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxBufferedOutputStream::wxBufferedOutputStream}
\func{}{wxBufferedOutputStream}{\param{const wxOutputStream\&}{ parent}}
Creates a buffered stream using a buffer of a default size of 1024 bytes for cashing
the stream {\it parent}.
\membersection{wxBufferedOutputStream::\destruct{wxBufferedOutputStream}}
\func{}{\destruct{wxBufferedOutputStream}}{\void}
Destructor. Calls Sync() and destroys the internal buffer.
\membersection{wxBufferedOutputStream::SeekO}
\func{off\_t}{SeekO}{\param{off\_t}{ pos}, \param{wxSeekMode}{ mode}}
Calls Sync() and changes the stream position.
\membersection{wxBufferedOutputStream::Sync}
\func{void}{Sync}{\void}
Flushes the buffer and calls Sync() on the parent stream.