Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > How large is the stream buffer?

Reply
Thread Tools

How large is the stream buffer?

 
 
Lambda
Guest
Posts: n/a
 
      07-15-2008
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?
 
Reply With Quote
 
 
 
 
James Kanze
Guest
Posts: n/a
 
      07-15-2008
On Jul 15, 2:28 pm, Lambda <(E-Mail Removed)> 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:(E-Mail Removed)
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
what is the different between byte stream and character stream? dolphin Java 6 03-18-2007 01:58 PM
get stream mode flags from an opened stream Alexander Korsunsky C++ 1 02-17-2007 10:38 AM
How to GET multi-word input from a *file* stream as opposed to a *console* stream? sherifffruitfly@gmail.com C++ 9 04-27-2006 04:14 PM
Doing readline in a thread from a popen4('rsync ...') stream blocks when the stream ends. Rasmusson, Lars Python 1 04-30-2004 08:10 AM



Advertisments