Class LoggingInterceptor.LoggingStream

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

    class LoggingInterceptor.LoggingStream
    extends java.io.FilterOutputStream
    Helper class used to log an entity to the output stream up to the specified maximum number of bytes.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.StringBuilder b  
      private java.io.ByteArrayOutputStream baos  
      • Fields inherited from class java.io.FilterOutputStream

        out
    • Constructor Summary

      Constructors 
      Constructor Description
      LoggingStream​(java.lang.StringBuilder b, java.io.OutputStream inner)
      Creates LoggingStream with the entity and the underlying output stream as parameters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) java.lang.StringBuilder getStringBuilder​(java.nio.charset.Charset charset)  
      void write​(int i)  
      • Methods inherited from class java.io.FilterOutputStream

        close, flush, write, write
      • Methods inherited from class java.io.OutputStream

        nullOutputStream
      • Methods inherited from class java.lang.Object

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

      • b

        private final java.lang.StringBuilder b
      • baos

        private final java.io.ByteArrayOutputStream baos
    • Constructor Detail

      • LoggingStream

        LoggingStream​(java.lang.StringBuilder b,
                      java.io.OutputStream inner)
        Creates LoggingStream with the entity and the underlying output stream as parameters.
        Parameters:
        b - contains the entity to log.
        inner - the underlying output stream.
    • Method Detail

      • getStringBuilder

        java.lang.StringBuilder getStringBuilder​(java.nio.charset.Charset charset)
      • write

        public void write​(int i)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterOutputStream
        Throws:
        java.io.IOException