#include </home/zeitlin/src/wx/github/interface/wx/stream.h>
This stream acts as a cache.
It caches the bytes to be written to the specified output stream (See wxFilterOutputStream). The data is 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).
Public Member Functions | |
wxBufferedOutputStream (wxOutputStream &stream, wxStreamBuffer *buffer=NULL) | |
Constructor using the provided buffer or default. | |
wxBufferedOutputStream (wxOutputStream &stream, size_t bufsize) | |
Constructor allowing to specify the size of the buffer. | |
virtual | ~wxBufferedOutputStream () |
Destructor. | |
virtual wxFileOffset | SeekO (wxFileOffset pos, wxSeekMode mode=wxFromStart) |
Calls Sync() and changes the stream position. | |
virtual void | Sync () |
Flushes the buffer and calls Sync() on the parent stream. |
wxBufferedOutputStream::wxBufferedOutputStream | ( | wxOutputStream & | stream, |
wxStreamBuffer * | buffer = NULL |
||
) |
Constructor using the provided buffer or default.
stream | The associated low-level stream. |
buffer | The buffer to use if non-NULL. Notice that the ownership of this buffer is taken by the stream, i.e. it will delete it. If this parameter is NULL a default 1KB buffer is used. |
wxBufferedOutputStream::wxBufferedOutputStream | ( | wxOutputStream & | stream, |
size_t | bufsize | ||
) |
Constructor allowing to specify the size of the buffer.
This is just a more convenient alternative to creating a wxStreamBuffer of the given size and using the other overloaded constructor of this class.
stream | The associated low-level stream. |
bufsize | The size of the buffer, in bytes. |
virtual wxBufferedOutputStream::~wxBufferedOutputStream | ( | ) | [virtual] |
Destructor.
Calls Sync() and destroys the internal buffer.
virtual wxFileOffset wxBufferedOutputStream::SeekO | ( | wxFileOffset | pos, |
wxSeekMode | mode = wxFromStart |
||
) | [virtual] |
Calls Sync() and changes the stream position.
Reimplemented from wxOutputStream.
virtual void wxBufferedOutputStream::Sync | ( | ) | [virtual] |
Flushes the buffer and calls Sync() on the parent stream.