By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,310 Members | 1,430 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,310 IT Pros & Developers. It's quick & easy.

How large is the stream buffer?

P: n/a
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?

If I want to write a large file, need I define a stream buffer myself?
In what situation, user-defined stream buffer is useful?
Jul 15 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Jul 15, 2:28 pm, Lambda <stephenh...@gmail.comwrote:
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:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jul 15 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.