Module: Advanced Tools Package: Streams
Does not inherit
#include <rw/stream/RWBufferedByteOutputStreamImp.h>
The typedef RWBufferedByteOutputStreamImp implements a buffer that can be used with byte output streams. The size of the buffer is specified in its static member make() function that is used to create it. The buffer's role is to store bytes up to its maximum capacity, and then forward them to its associated sink stream. The buffer flushes itself upon destruction.
// A buffer for binary output streams #include <rw/stream/RWBufferedByteOutputStreamImp.h> #include <rw/stream/RWByteToStreambufOutputStreamImp.h> #include <rw/stream/RWNativeDataToByteOutputStreamImp.h> #include <fstream.h> int main() { filebuf fbuf; fbuf.open("RWBufferedByteOutputStreamImp.out", ios::out | ios::binary); RWByteOutputStream binStream = RWByteToStreambufOutputStreamImp::make(fbuf); RWByteOutputStream bufferedStream = RWBufferedByteOutputStreamImp::make(binStream); RWStreambufToByteOutputStream adaptor(bufferedStream); ostream out(&adaptor); int i = 42; out << i; return 0; }
typedef RWTOutputStreamBufferImp<RWByteOutputStream, RWFilteredByteOutputStreamImp> RWBufferedByteOutputStreamImp;
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.