| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final JdkConsole | |
| private final LazyConstant | |
| private final LazyConstant |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Charset | charset()
Overrides java. Returns the |
| public void | flush()
Overrides java. Implements java. Flushes the console and forces any buffered output to be written immediately. |
| public Console | format(String format, Object... args)
Overrides java. Writes a formatted string to this console's output stream using
the specified format string and arguments with the
|
| public Console | format(Locale locale, String format, Object... args)
Overrides java. Writes a formatted string to this console's output stream using
the specified format string and arguments with the specified
|
| public Console | printf(String format, Object... args)
Overrides java. A convenience method to write a formatted string to this console's
output stream using the specified format string and arguments with
the |
| public Console | printf(Locale locale, String format, Object... args)
Overrides java. A convenience method to write a formatted string to this console's
output stream using the specified format string and arguments with
the specified |
| public Reader | reader()
Overrides java. Retrieves the unique |
| public String | readLine(String format, Object... args)
Overrides java. Provides a formatted prompt using the
|
| public String | readLine(Locale locale, String format, Object... args)
Overrides java. Provides a formatted prompt using the specified |
| public String | |
| public char[] | readPassword(String format, Object... args)
Overrides java. Provides a formatted prompt using the
|
| public char[] | readPassword(Locale locale, String format, Object... args)
Overrides java. Provides a formatted prompt using the specified |
| public char[] | readPassword()
Overrides java. Reads a password or passphrase from the console with echoing disabled. |
| public PrintWriter | writer()
Overrides java. Retrieves the unique |
| delegate | back to summary |
|---|---|
| private final JdkConsole delegate | |
| printWriter | back to summary |
|---|---|
| private final LazyConstant<PrintWriter> printWriter | |
| reader | back to summary |
|---|---|
| private final LazyConstant<Reader> reader | |
| ProxyingConsole | back to summary |
|---|---|
| pack-priv ProxyingConsole(JdkConsole delegate) | |
| charset | back to summary |
|---|---|
| public Charset charset() Overrides java. Doc from java. Returns the
The returned charset is used for encoding the data that is sent to
the output (e.g., display), specified by the host environment or user.
It defaults to the one based on
| |
| flush | back to summary |
|---|---|
| public void flush() Overrides java. Implements java. Doc from java. Flushes the console and forces any buffered output to be written immediately.
| |
| format | back to summary |
|---|---|
| public Console format(String format, Object... args) Overrides java. Doc from java. Writes a formatted string to this console's output stream using
the specified format string and arguments with the
| |
| format | back to summary |
|---|---|
| public Console format(Locale locale, String format, Object... args) Overrides java. Doc from java. Writes a formatted string to this console's output stream using
the specified format string and arguments with the specified
| |
| printf | back to summary |
|---|---|
| public Console printf(String format, Object... args) Overrides java. Doc from java. A convenience method to write a formatted string to this console's
output stream using the specified format string and arguments with
the
| |
| printf | back to summary |
|---|---|
| public Console printf(Locale locale, String format, Object... args) Overrides java. Doc from java. A convenience method to write a formatted string to this console's
output stream using the specified format string and arguments with
the specified
| |
| reader | back to summary |
|---|---|
| public Reader reader() Overrides java. Doc from java. Retrieves the unique
This method is intended to be used by sophisticated applications, for
example, a Console con = System.console(); if (con != null) { Scanner sc = new Scanner(con.reader()); ... }
For simple applications requiring only line-oriented reading, use
The bulk read operations
| |
| readLine | back to summary |
|---|---|
| public String readLine(String format, Object... args) Overrides java. Doc from java. Provides a formatted prompt using the
| |
| readLine | back to summary |
|---|---|
| public String readLine(Locale locale, String format, Object... args) Overrides java. Doc from java. Provides a formatted prompt using the specified
| |
| readLine | back to summary |
|---|---|
| public String readLine() Overrides java. Doc from java. Reads a single line of text from the console.
| |
| readPassword | back to summary |
|---|---|
| public char[] readPassword(String format, Object... args) Overrides java. Doc from java. Provides a formatted prompt using the
| |
| readPassword | back to summary |
|---|---|
| public char[] readPassword(Locale locale, String format, Object... args) Overrides java. Doc from java. Provides a formatted prompt using the specified
| |
| readPassword | back to summary |
|---|---|
| public char[] readPassword() Overrides java. Doc from java. Reads a password or passphrase from the console with echoing disabled.
| |
| writer | back to summary |
|---|---|
| public PrintWriter writer() Overrides java. Doc from java. Retrieves the unique
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Reader |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements abstract java. Implements java. Closes the stream and releases any system resources associated with it. |
| public int | read(char[] cbuf, int off, int len)
Implements abstract java. Reads characters into a portion of an array. |
| r | back to summary |
|---|---|
| private final Reader r | |
| WrappingReader | back to summary |
|---|---|
| pack-priv WrappingReader(Reader r) | |
| close | back to summary |
|---|---|
| public void close() Implements abstract java. Implements java. Doc from java. Closes the stream and releases any system resources associated with it. Once the stream has been closed, further read(), ready(), mark(), reset(), or skip() invocations will throw an IOException. Closing a previously closed stream has no effect.
| |
| read | back to summary |
|---|---|
| public int read(char[] cbuf, int off, int len) throws IOException Implements abstract java. Doc from java. Reads characters into a portion of an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached. If
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. Closes the stream and releases any system resources associated with it. |
| WrappingWriter | back to summary |
|---|---|
| public WrappingWriter(PrintWriter pw) | |
| close | back to summary |
|---|---|
| public void close() Overrides java. Implements java. Doc from java. Closes the stream and releases any system resources associated with it. Closing a previously closed stream has no effect.
| |