Module: Advanced Tools Package: Streams
Does not inherit
#include <rw/stream/RWBufferedByteInputStreamImp.h>
The typedef RWBufferedByteInputStreamImp implements a buffer that can be used with binary input streams. The size of the buffer is specified in its static member make() function that is used to create it.
// A buffer for binary input streams #include <rw/stream/RWBufferedByteInputStreamImp.h> #include <rw/stream/RWByteFromStreambufInputStreamImp.h> #include <rw/stream/RWNativeDataFromByteInputStreamImp.h> #include <iostream.h> #include <fstream.h> #include <rw/rwfile.h> int main() { filebuf fbuf; if (!RWFile::Exists("RWBufferedByteOutputStreamImp.out")) { cout << "The input file does not exist." << endl; } else { fbuf.open("RWBufferedByteOutputStreamImp.out", ios::in | ios::binary); RWByteInputStream binStream = RWByteFromStreambufInputStreamImp::make(fbuf); RWByteInputStream bufferedStream = RWBufferedByteInputStreamImp::make(binStream, 512); RWStreambufFromByteInputStream adaptor(bufferedStream); istream in(&adaptor); int i; in >> i; cout << i << endl; } return 0; }
typedef RWTInputStreamBufferImp<RWByteInputStream, RWFilteredByteInputStreamImp> RWBufferedByteInputStreamImp;
© 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.