Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8179662

OutputStreamWriter javadocs states that you can set the buffer size but there is no way to do that

    Details

    • Subcomponent:
    • Resolved In Build:
      b169
    • Verification:
      Not verified

      Backports

        Description

        FULL PRODUCT VERSION :
        openjdk version "1.8.0_121"
        OpenJDK Runtime Environment (build 1.8.0_121-b13)
        OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)


        ADDITIONAL OS VERSION INFORMATION :
        Linux 4.4.43-rh58

        A DESCRIPTION OF THE PROBLEM :
        The javadocs for the standard java.io.OutputStreamWriter class says that you can set the buffer size:

        "The size of this buffer may be specified, but by default it is large enough for most purposes."

        This is clearly false. It was true in Java 1.1, but the relevant constructor does not exist since then. And, it seems, the docs were never updated.


        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Read the java.io.OutputStreamWriter javadocs, eg http://docs.oracle.com/javase/8/docs/api/java/io/OutputStreamWriter.html

        Second paragraph of the class description says:

        "Each invocation of a write() method causes the encoding converter to be invoked on the given character(s). The resulting bytes are accumulated in a buffer before being written to the underlying output stream. The size of this buffer may be specified, but by default it is large enough for most purposes. Note that the characters passed to the write() methods are not buffered."

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        One expects to find a constructor that lets you choose the buffer size.
        ACTUAL -
        There is no such constructor (nor setter).

        REPRODUCIBILITY :
        This bug can be reproduced always.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  bpb Brian Burkhalter
                  Reporter:
                  webbuggrp Webbug Group
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: