public abstract class StreamBasedTerminal extends InputEnabledAbstractTerminal
Terminal.Color, Terminal.ResizeListener, Terminal.SGR
Modifier and Type | Field and Description |
---|---|
protected Object |
writerMutex |
Constructor and Description |
---|
StreamBasedTerminal(InputStream terminalInput,
OutputStream terminalOutput,
Charset terminalCharset) |
Modifier and Type | Method and Description |
---|---|
void |
flush()
Calls
flush() on the underlying OutputStream object, or
whatever other implementation this terminal is built around. |
void |
putCharacter(char c)
Outputs a single character to the terminal output stream, translating any
UTF-8 graphical symbol if necessary
|
protected byte[] |
translateCharacter(char input) |
protected void |
writeToTerminal(byte... bytes)
Allow subclasses (that are supposed to know what they're doing) to write directly to the terminal
Warning! Be sure to call this method INSIDE of a synchronize(writeMutex) block!!! The reason is that many control sequences are a group of bytes and we want to synchronize the whole thing rather than each character one by one. |
addInputProfile, readInput, waitForTerminalSizeReport
addResizeListener, getLastKnownSize, onResized, removeResizeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyBackgroundColor, applyBackgroundColor, applyBackgroundColor, applyForegroundColor, applyForegroundColor, applyForegroundColor, applySGR, clearScreen, enterPrivateMode, exitPrivateMode, getTerminalSize, moveCursor, queryTerminalSize, setCursorVisible
protected final Object writerMutex
public StreamBasedTerminal(InputStream terminalInput, OutputStream terminalOutput, Charset terminalCharset)
public void putCharacter(char c)
c
- Character to write to the output streamLanternaException
protected void writeToTerminal(byte... bytes)
public void flush()
Terminal
flush()
on the underlying OutputStream
object, or
whatever other implementation this terminal is built around.protected byte[] translateCharacter(char input)
Copyright © 2015. All Rights Reserved.