Re: How large is the stream buffer?
On Jul 15, 2:28 pm, Lambda <stephenh...@gmail.com> wrote:
As I know, when I use ifstream and ofstream to read and write file,
it will use a stream buffer internally.
How large is the stream buffer?
About so big.
It depends on the implementation, and will often be optimized
for the system you're running under.
If I want to write a large file, need I define a stream buffer
myself?
No.
In what situation, user-defined stream buffer is useful?
Any time the non-standard ones aren't sufficient. The most
frequent use is probably filtering streambuf's; it's hard to
imagine an application that doesn't use at least one (if only
for log dispatching). Non-filtering user written streambuf's
are used to interface with sockets, pipes, raw memory, or just
about anything else besides ordinary files and std::strings.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34