RFR: 8356420: Provide examples on wrapping System.in [v3]

Chen Liang liach at openjdk.org
Sun May 11 15:17:55 UTC 2025


On Fri, 9 May 2025 21:29:09 GMT, Naoto Sato <naoto at openjdk.org> wrote:

>> With the introduction of `stdin.encoding` ([JDK-8350703](https://bugs.openjdk.org/browse/JDK-8350703)), some guidance for users to decode `System.in` would be desirable. Adding examples in the field description would help.
>
> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Reflects another review comment

I looked for the other mentions of System.in without references to stdin.encoding, notably:
1. FileDescriptor.in: Unfortunately FileInputStream(FileDescriptor) has no overload that supports custom charsets. We should probably document both on this FD and that constructor.
2. JShell.in and JavaShellToolBuilder.in 
3. A few usages in security, like password reading in sun.security.tools.keytool.Main, or javax.security.auth.callback.CallbackHandler

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25155#issuecomment-2869933924


More information about the core-libs-dev mailing list