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