Class TerminalPrintStream

java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.PrintStream
org.elasticsearch.cli.terminal.internal.TerminalPrintStream
All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable

public class TerminalPrintStream extends PrintStream
A PrintStream that writes lines to the current Terminal.

To avoid interleaving when multiple threads write to the same stream, each thread gets its own line buffer via ThreadLocal. This prevents partial-line writes from one thread from being merged with writes from another thread.