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