{
final boolean lastChunk;
final int chunkLength = Math.min((int) (bodySize - pos), minLargeMessageSize);
final HornetQBuffer bodyBuffer = HornetQBuffers.fixedBuffer(chunkLength);
context.encode(bodyBuffer, chunkLength);
pos += chunkLength;
lastChunk = pos >= bodySize;
final boolean requiresResponse = lastChunk && sendBlocking;
SendAcknowledgementHandler messageHandler = lastChunk ? handler : null;
final SessionSendContinuationMessage chunk =
new SessionSendContinuationMessage(msgI, bodyBuffer.toByteBuffer().array(), !lastChunk,
requiresResponse, messageHandler);
if (requiresResponse)
{
// When sending it blocking, only the last chunk will be blocking.