Class AnsiOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.PrintStream
com.github.rvesse.airline.io.output.AnsiOutputStream
- All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable
- Direct Known Subclasses:
ColorizedOutputStream
An output stream that supports customized output via ANSI control codes
-
Field Summary
FieldsFields inherited from class FilterOutputStream
out -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidapplyAll()Method which applies any necessary controls to the streamvoidclose()final voidRegisters a controlfinal voidregisterControls(OutputStreamControlTracker... controls) Registers some controlsvoidreset(boolean full) Resets the stream to the default state i.e.protected final voidresetAll()Method which resets the state of any controls that have been previously enabled and applied to the streamvoidwrite(byte[] b) voidwrite(byte[] b, int off, int len) voidwrite(int b) Methods inherited from class PrintStream
append, append, append, charset, checkError, clearError, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, writeBytesMethods inherited from class OutputStream
nullOutputStream
-
Field Details
-
controls
-
-
Constructor Details
-
AnsiOutputStream
-
-
Method Details
-
registerControl
Registers a controlThis method can be useful if you wish to add additional controls beyond those provided by a specific class derived from this abstract class.
- Parameters:
control- Control
-
registerControls
Registers some controls- Parameters:
controls- Controls
-
write
public void write(int b) - Overrides:
writein classPrintStream
-
write
- Overrides:
writein classPrintStream- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) - Overrides:
writein classPrintStream
-
applyAll
protected final void applyAll()Method which applies any necessary controls to the stream -
reset
public void reset(boolean full) Resets the stream to the default state i.e. disables all controls that may previously have been applied such as colors, text decorations etc- Parameters:
full- If true do a full graphics reset in addition to resetting the individual controls
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classPrintStream
-
resetAll
protected final void resetAll()Method which resets the state of any controls that have been previously enabled and applied to the stream
-