Class LoggerInputStream

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

    public class LoggerInputStream
    extends java.io.FilterInputStream
    Logs each line read to a pre-defined level. Can also be configured with a Marker.
    Since:
    2.1
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String FQCN  
      private InternalInputStream logger  
      • Fields inherited from class java.io.FilterInputStream

        in
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected LoggerInputStream​(java.io.InputStream in, java.nio.charset.Charset charset, ExtendedLogger logger, java.lang.String fqcn, Level level, Marker marker)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      int read()  
      int read​(byte[] b)  
      int read​(byte[] b, int off, int len)  
      java.lang.String toString()  
      • Methods inherited from class java.io.FilterInputStream

        available, mark, markSupported, reset, skip
      • Methods inherited from class java.io.InputStream

        nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • FQCN

        private static final java.lang.String FQCN
    • Constructor Detail

      • LoggerInputStream

        protected LoggerInputStream​(java.io.InputStream in,
                                    java.nio.charset.Charset charset,
                                    ExtendedLogger logger,
                                    java.lang.String fqcn,
                                    Level level,
                                    Marker marker)
    • Method Detail

      • 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.FilterInputStream
        Throws:
        java.io.IOException
      • read

        public int read()
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterInputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b)
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterInputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterInputStream
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object