- java.lang.Object
-
- java.io.Writer
-
- java.io.StringWriter
-
- org.jline.reader.PrintAboveWriter
-
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
public class PrintAboveWriter extends StringWriter
Redirects aWriter
to aLineReader
'sLineReader.printAbove(String)
method, which draws output above the current prompt / input line.Example:
LineReader reader = LineReaderBuilder.builder().terminal(terminal).parser(parser).build(); PrintAboveWriter printAbove = new PrintAboveWriter(reader); printAbove.write(new char[] { 'h', 'i', '!', '\n'});
-
-
Constructor Summary
Constructors Constructor Description PrintAboveWriter(LineReader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
flush()
-
Methods inherited from class java.io.StringWriter
append, append, append, close, getBuffer, toString, write, write, write, write
-
Methods inherited from class java.io.Writer
nullWriter, write
-
-
-
-
Constructor Detail
-
PrintAboveWriter
public PrintAboveWriter(LineReader reader)
-
-
Method Detail
-
flush
public void flush()
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classStringWriter
-
-