Class LogOutputStream

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

    public class LogOutputStream
    extends java.io.ByteArrayOutputStream
    Defines a new ByteArrayOutputStream that convert the bytes into a message and invokes the in constructor exist logger
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected ILogger logger
      The logger for this outputStream
      protected LogLevel logLevel
      The LogLevel in that the logger should log the incoming message
      • Fields inherited from class java.io.ByteArrayOutputStream

        buf, count
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void flush()  
      ILogger getLogger()  
      LogLevel getLogLevel()  
      • Methods inherited from class java.io.ByteArrayOutputStream

        close, reset, size, toByteArray, toString, toString, toString, toString, write, write, writeBytes, writeTo
      • Methods inherited from class java.io.OutputStream

        nullOutputStream, write
      • Methods inherited from class java.lang.Object

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

      • logger

        protected final ILogger logger
        The logger for this outputStream
      • logLevel

        protected final LogLevel logLevel
        The LogLevel in that the logger should log the incoming message
    • Constructor Detail

      • LogOutputStream

        public LogOutputStream​(ILogger logger,
                               LogLevel logLevel)
      • LogOutputStream

        public LogOutputStream​(int size,
                               ILogger logger,
                               LogLevel logLevel)
    • Method Detail

      • getLogger

        public ILogger getLogger()
      • getLogLevel

        public LogLevel getLogLevel()
      • flush

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