ArrayListMessageFactory.instance);
if (startSeqId + i > messageList.size()) {
request.getCallback().scanFinished(request.getCtx(), ReasonForFinish.NO_MORE_MESSAGES);
return;
}
Message msg = messageList.get((int) startSeqId + i - 1);
Message toDeliver = MessageIdUtils.mergeLocalSeqId(msg, startSeqId + i);
request.getCallback().messageScanned(request.getCtx(), toDeliver);
totalSize += toDeliver.getBody().size();
if (totalSize > request.getSizeLimit()) {
request.getCallback().scanFinished(request.getCtx(), ReasonForFinish.SIZE_LIMIT_EXCEEDED);
return;
}