code: protected static ByteBuffer toTCPBuffer(GelfMessage message, ThreadLocal<ByteBuffer> writeBuffers) {
  
          while (true) {
  
              try {
                  return message.toTCPBuffer(getBuffer(writeBuffers));
              } catch (BufferOverflowException e) {
                  enlargeBuffer(writeBuffers);
              }
          }
      }
docs: Create TCP buffer and apply auto-buffer-enlarging, if necessary.
  
  @param message
  @param writeBuffers
  @return