Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Re: which OutputStreams are buffered?

Reply
Thread Tools

Re: which OutputStreams are buffered?

 
 
Knute Johnson
Guest
Posts: n/a
 
      05-16-2008
Rex Mottram wrote:
> There is a java.io.BufferedOutputStream whose purpose is well
> documented, basically as a good thing to wrap around an unbuffered
> OutputStream (at least if you want buffering). However, and surprisingly
> to me, a number of the other OutputStreams in java.io do not document
> whether they are buffered, and thus it's not clear to me whether I
> should wrap them or not.
>
> Take FileOutputStream as an example: the docs say only that it's "... an
> output stream for writing data to a File ...". Can we safely infer that
> a stream is buffered iff it implements Flushable? Otherwise, what's the
> way to know when wrapping in a BufferedOutputStream is a good idea and
> when it would lead to redundant buffering?
>
> Thanks,
> RM


If it doesn't say buffered it isn't.

--

Knute Johnson
email s/nospam/linux/

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
 
Reply With Quote
 
 
 
 
Knute Johnson
Guest
Posts: n/a
 
      05-16-2008
Rex Mottram wrote:
> Knute Johnson wrote:
>> If it doesn't say buffered it isn't.

>
> Do you mean "if the class name doesn't match /Buffered/, it isn't"?


Yes.

> That would make sense, but it raises the question of why would any
> OutputStream implement Flushable if it doesn't have a buffer to flush?
>
> RM


Don't quote me but I think the that is to signal the underlying OS to flush.

--

Knute Johnson
email s/nospam/linux/

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
 
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: which OutputStreams are buffered? Tom Anderson Java 9 05-21-2008 12:26 PM
(File)OutputStreams and their usage Philipp Java 15 05-17-2008 11:26 AM
Best inputstreams/outputstreams for sockets Bruce Lee Java 1 12-07-2004 08:37 PM
Problems using ASPNET OutputStreams Yurai Núñez Rodríguez ASP .Net 0 05-02-2004 07:20 PM
closing writers and outputstreams Andy Fish Java 1 11-13-2003 10:18 AM



Advertisments