void drainOnReadIfNeeded ( int bufferIndex , long writeCount ) { final long pending = ( writeCount - readBufferDrainAtWriteCount [ bufferIndex ] . get ( ) ) ; final boolean delayable = ( pending < READ_BUFFER_THRESHOLD ) ; final DrainStatus status = drainStatus . get ( ) ; if ( status . shouldDrainBuffers ( delayable ) ) { tryToDrainBuffers ( ) ; } }
Attempts to drain the buffers if it is determined to be needed when post - processing a read .