Class Wire


  • @Internal
    public class Wire
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String id  
      private org.slf4j.Logger log  
      private static int MAX_STRING_BUILDER_SIZE  
      private static java.lang.ThreadLocal<java.lang.StringBuilder> THREAD_LOCAL  
    • Constructor Summary

      Constructors 
      Constructor Description
      Wire​(org.slf4j.Logger log, java.lang.String id)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.lang.StringBuilder getStringBuilder()
      Returns a StringBuilder that this Layout implementation can use to write the formatted log event to.
      void input​(byte[] b)  
      void input​(byte[] b, int pos, int off)  
      void input​(int b)  
      void input​(java.lang.String s)  
      void input​(java.nio.ByteBuffer b)  
      boolean isEnabled()  
      void output​(byte[] b)  
      void output​(byte[] b, int pos, int off)  
      void output​(int b)  
      void output​(java.lang.String s)  
      void output​(java.nio.ByteBuffer b)  
      private static void trimToMaxSize​(java.lang.StringBuilder stringBuilder, int maxSize)
      Ensures that the char[] array of the specified StringBuilder does not exceed the specified number of characters.
      private void wire​(java.lang.String header, byte[] b, int pos, int off)  
      • Methods inherited from class java.lang.Object

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

      • MAX_STRING_BUILDER_SIZE

        private static final int MAX_STRING_BUILDER_SIZE
        See Also:
        Constant Field Values
      • THREAD_LOCAL

        private static final java.lang.ThreadLocal<java.lang.StringBuilder> THREAD_LOCAL
      • log

        private final org.slf4j.Logger log
      • id

        private final java.lang.String id
    • Constructor Detail

      • Wire

        public Wire​(org.slf4j.Logger log,
                    java.lang.String id)
    • Method Detail

      • getStringBuilder

        private static java.lang.StringBuilder getStringBuilder()
        Returns a StringBuilder that this Layout implementation can use to write the formatted log event to.
        Returns:
        a StringBuilder
      • trimToMaxSize

        private static void trimToMaxSize​(java.lang.StringBuilder stringBuilder,
                                          int maxSize)
        Ensures that the char[] array of the specified StringBuilder does not exceed the specified number of characters. This method is useful to ensure that excessively long char[] arrays are not kept in memory forever.
        Parameters:
        stringBuilder - the StringBuilder to check
        maxSize - the maximum number of characters the StringBuilder is allowed to have
      • wire

        private void wire​(java.lang.String header,
                          byte[] b,
                          int pos,
                          int off)
      • isEnabled

        public boolean isEnabled()
      • output

        public void output​(byte[] b,
                           int pos,
                           int off)
      • input

        public void input​(byte[] b,
                          int pos,
                          int off)
      • output

        public void output​(byte[] b)
      • input

        public void input​(byte[] b)
      • output

        public void output​(int b)
      • input

        public void input​(int b)
      • output

        public void output​(java.lang.String s)
      • input

        public void input​(java.lang.String s)
      • output

        public void output​(java.nio.ByteBuffer b)
      • input

        public void input​(java.nio.ByteBuffer b)