BufferedInputStream vs BufferedReader - Java

This is a discussion on BufferedInputStream vs BufferedReader - Java ; Has anyone done any experiments on which is preferable -- putting your buffering at the BufferedInputStream level or the BufferedReader level when you have a Reader? -- Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com...

+ Reply to Thread
Results 1 to 2 of 2

BufferedInputStream vs BufferedReader

  1. Default BufferedInputStream vs BufferedReader

    Has anyone done any experiments on which is preferable -- putting your
    buffering at the BufferedInputStream level or the BufferedReader level
    when you have a Reader?
    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com

  2. Default Re: BufferedInputStream vs BufferedReader

    On Aug 5, 3:37 pm, Roedy Green <see_webs...@mindprod.com.invalid>
    wrote:
    > Has anyone done any experiments on which is preferable -- putting your
    > buffering at the BufferedInputStream level or the BufferedReader level
    > when you have a Reader?


    Buffer as low / as early in the chain as possible. That way there is
    more code on top of the buffer that might profit from it. Might, but
    need not. That depends on what code you have on top of the buffer.

    For example, an InputStreamReader decoding some multi-byte char
    encoding (UTF ...) needs of course to read more than one byte to
    decode one char. How it does that is implementation dependent. It
    could do that with a sequence of one-byte reads. In that case a buffer
    below could speed up things. Another InputStreamReader could buffer on
    its own. In this case a buffer below would not help (but not hurt
    much), but a buffer above maybe also not help.


+ Reply to Thread

Similar Threads

  1. BufferedReader.readLine() blocks unexpected
    By Application Development in forum Java
    Replies: 10
    Last Post: 10-11-2007, 04:41 PM
  2. FileReader / BufferedReader Help
    By Application Development in forum Java
    Replies: 24
    Last Post: 08-11-2007, 12:35 AM
  3. BufferedReader do not change output for new file
    By Application Development in forum Java
    Replies: 7
    Last Post: 07-27-2007, 05:07 PM
  4. System.out.print() and BufferedReader.readLine()
    By Application Development in forum Java
    Replies: 2
    Last Post: 06-05-2007, 11:33 PM
  5. Make BufferedReader.readLine() not consider \r EOL
    By Application Development in forum Java
    Replies: 1
    Last Post: 06-30-2004, 05:14 AM