long timestamp = System.currentTimeMillis();
long timePeriod = -1;
do
{
limit = headerBuf.limit();
// increase the byte buffer if it's free memory falls below 20 percent
if ( headerBuf.remaining() <= (limit / 5) )
{
logger.log( Level.FINEST, "Allocating additional " + (limit / 2) + "b for buffer with " + limit + "b" );
headerBuf = ByteBufferAllocator.reAllocate( headerBuf, limit + (limit / 2) );