Class AnsiOutputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    public class AnsiOutputStream
    extends java.io.FilterOutputStream
    A ANSI print stream extracts ANSI escape codes written to an output stream and calls corresponding AnsiProcessor.process* methods. This particular class is not synchronized for improved performances.

    For more information about ANSI escape codes, see Wikipedia article

    Since:
    1.0
    See Also:
    AnsiProcessor
    • Method Detail

      • setMode

        public void setMode​(AnsiMode mode)
      • isResetAtUninstall

        public boolean isResetAtUninstall()
      • setResetAtUninstall

        public void setResetAtUninstall​(boolean resetAtUninstall)
      • write

        public void write​(int data)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterOutputStream
        Throws:
        java.io.IOException
      • processCharsetSelect

        private void processCharsetSelect()
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • processOperatingSystemCommand

        private void processOperatingSystemCommand()
                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • processEscapeCommand

        private void processEscapeCommand​(int data)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • reset

        private void reset​(boolean skipBuffer)
                    throws java.io.IOException
        Resets all state to continue with regular parsing
        Parameters:
        skipBuffer - if current buffer should be skipped or written to out
        Throws:
        java.io.IOException
      • install

        public void install()
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • uninstall

        public void uninstall()
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.FilterOutputStream
        Throws:
        java.io.IOException