Re: which OutputStreams are buffered?

Discussion in 'Java' started by Knute Johnson, May 16, 2008.

  1. 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
    Knute Johnson, May 16, 2008
    #1
    1. Advertising

  2. 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
    Knute Johnson, May 16, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Yurai Núñez Rodríguez

    Problems using ASPNET OutputStreams

    Yurai Núñez Rodríguez, May 2, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    287
    Yurai Núñez Rodríguez
    May 2, 2004
  2. Andy Fish

    closing writers and outputstreams

    Andy Fish, Nov 13, 2003, in forum: Java
    Replies:
    1
    Views:
    493
    Thomas Weidenfeller
    Nov 13, 2003
  3. Bruce Lee
    Replies:
    1
    Views:
    348
    Steve Horsley
    Dec 7, 2004
  4. Replies:
    9
    Views:
    661
    Michael Wojcik
    Aug 23, 2005
  5. Tom Anderson

    Re: which OutputStreams are buffered?

    Tom Anderson, May 16, 2008, in forum: Java
    Replies:
    9
    Views:
    441
    Tom Anderson
    May 21, 2008
Loading...

Share This Page