Module de.carne
Package de.carne.io

Class AnsiFilter

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

    public class AnsiFilter
    extends java.io.FilterWriter
    Writer implementation used to remove ANSI escape codes from output (e.g. to write color enriched output to a dumb terminal).
    • Field Summary

      • Fields inherited from class java.io.FilterWriter

        out
      • Fields inherited from class java.io.Writer

        lock
    • Constructor Summary

      Constructors 
      Constructor Description
      AnsiFilter​(java.io.Writer out)
      Constructs a new AnsiFilter instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void flush()  
      void write​(char @Nullable [] cbuf, int off, int len)  
      void write​(int c)  
      void write​(@Nullable java.lang.String str, int off, int len)  
      • Methods inherited from class java.io.FilterWriter

        close
      • Methods inherited from class java.io.Writer

        append, append, append, nullWriter, write, write
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AnsiFilter

        public AnsiFilter​(java.io.Writer out)
        Constructs a new AnsiFilter instance.
        Parameters:
        out - the Writer instance to write to.
    • Method Detail

      • write

        public void write​(int c)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterWriter
        Throws:
        java.io.IOException
      • write

        public void write​(char @Nullable [] cbuf,
                          int off,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterWriter
        Throws:
        java.io.IOException
      • write

        public void write​(@Nullable java.lang.String str,
                          int off,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterWriter
        Throws:
        java.io.IOException
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface java.io.Flushable
        Overrides:
        flush in class java.io.FilterWriter
        Throws:
        java.io.IOException