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.
- duplicates
-
JDK-8350703 Add standard system property stdin.encoding
-
- Resolved
-