Package org.ghost4j

Class GhostscriptLoggerOutputStream

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

    public class GhostscriptLoggerOutputStream
    extends java.io.OutputStream
    Class used to wrap Ghostscript interpreter log messages in Slf4j messages.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.ByteArrayOutputStream baos
      ByteArrayOutputStream used to store outputed messages being written.
      private org.slf4j.event.Level level
      Log level used when outputing messages to the logger.
      private static int LINE_END
      Line termination for a log message.
      private org.slf4j.Logger logger
      Logger used to log messages.
      private static java.lang.String LOGGER_NAME
      Logger name.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void write​(int b)
      Write method that stores data to write in the ByteArrayOutputStream and sends messages to the logger when a line ends.
      • Methods inherited from class java.io.OutputStream

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

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

      • LOGGER_NAME

        private static final java.lang.String LOGGER_NAME
        Logger name.
      • LINE_END

        private static final int LINE_END
        Line termination for a log message.
        See Also:
        Constant Field Values
      • baos

        private java.io.ByteArrayOutputStream baos
        ByteArrayOutputStream used to store outputed messages being written.
      • logger

        private org.slf4j.Logger logger
        Logger used to log messages.
      • level

        private org.slf4j.event.Level level
        Log level used when outputing messages to the logger.
    • Constructor Detail

      • GhostscriptLoggerOutputStream

        public GhostscriptLoggerOutputStream​(org.slf4j.event.Level level)
        Constructor.
        Parameters:
        level - Defines the log level of outputed messages.
    • Method Detail

      • write

        public void write​(int b)
                   throws java.io.IOException
        Write method that stores data to write in the ByteArrayOutputStream and sends messages to the logger when a line ends.
        Specified by:
        write in class java.io.OutputStream
        Parameters:
        b - Byte to write
        Throws:
        java.io.IOException