} else {
decoderBuffer.wpos(decoderLength + 4 - pad);
buf = decoderBuffer;
}
if (log.isTraceEnabled()) {
log.trace("Received packet #{}: {}", seqi, buf.printHex());
}
// Process decoded packet
handleMessage(buf);
// Set ready to handle next packet
decoderBuffer.rpos(decoderLength + 4 + macSize);