Package org.ghost4j

Class GhostscriptLoggerOutputStream

java.lang.Object
java.io.OutputStream
org.ghost4j.GhostscriptLoggerOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

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

    • LOGGER_NAME

      private static final String LOGGER_NAME
      Logger name.
    • LINE_END

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

      private 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 Details

    • GhostscriptLoggerOutputStream

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

    • write

      public void write(int b) throws 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 OutputStream
      Parameters:
      b - Byte to write
      Throws:
      IOException