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

OutputStreamWriter doc says buffer size can be specified, but it can't

XMLWordPrintable

      A DESCRIPTION OF THE PROBLEM :
      The documentation of the class java.io.OutputStreamWriter 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."

      None of the constructors allow the buffer size to be specified. It was possible to specify the buffer size in Java SE 1.1 (source: [1], doc: [2]), but the constructor overloads were removed in Java SE 1.2 [3] and the documentation wasn't updated.

      This bug is present in Java SE 1.2 through 9-ea+163).

      References:

      [1] Stack Overflow question: http://stackoverflow.com/questions/27532645/outputstreamwriter-internal-buffer-size#27533181
      [2] Archived documentation of OutputStreamWriter, Java 1.1: http://web.archive.org/web/20131222065740/http://www.cs.mun.ca/~michael/java/jdk1.1-beta2-docs/api/java.io.OutputStreamWriter.html
      [3] Archived documentation of OutputStreamWriter, Java 1.2: http://web.archive.org/web/20150222112550/http://www.cs.mun.ca/~michael/java/jdk1.2-docs/api/java/io/OutputStreamWriter.html

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      "The size of this buffer cannot be specified"
      ACTUAL -
      "The size of this buffer may be specified"

      URL OF FAULTY DOCUMENTATION :
      https://docs.oracle.com/javase/8/docs/api/java/io/OutputStreamWriter.html

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: