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

Add note to System.in regarding usage with charset decoders

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • None
    • core-libs
    • None

      There should be a note on System.in that explains that, to read character data, it must be wrapped in something that decodes characters. For example, InputStreamReader or Scanner. Once this is done, System.in effectively cannot be used anymore, as the decoder is allowed to read and buffer extra bytes; the object doing the decoding must henceforth be the only one used for reading from standard input. Interleaving reads from System.in results in unspecified behavior.

            smarks Stuart Marks
            smarks Stuart Marks
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: