if (LOGGER.isInfoEnabled()) {
LOGGER.info("Now reading sequences of length " + blocks + " blocks.");
}
connection.nextState(new ReadRequestState(connection, dst, TaskAttributes.SIMPLE, (int) Math.min(bytes2Process, blocks * blockSize), startAddress, blocks));
startAddress += blocks;
totalBlocks -= blocks;
bytes2Process -= blocks * blockSize;
// second stage
blocks = (short) Math.min(READ_SECOND_STAGE_BLOCKS, totalBlocks);
if (blocks > 0) {
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Now reading sequences of length " + blocks + " blocks.");
}
connection.nextState(new ReadRequestState(connection, dst, TaskAttributes.SIMPLE, (int) Math.min(bytes2Process, blocks * blockSize), startAddress, blocks));
startAddress += blocks;
totalBlocks -= blocks;
bytes2Process -= blocks * blockSize;
}
// third stage
blocks = (short) Math.min(READ_THIRD_STAGE_BLOCKS, totalBlocks);
while (blocks > 0) {
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Now reading sequences of length " + blocks + " blocks.");
}
connection.nextState(new ReadRequestState(connection, dst, TaskAttributes.SIMPLE, (int) Math.min(bytes2Process, blocks * blockSize), startAddress, blocks));
startAddress += blocks;
totalBlocks -= blocks;
blocks = (short) Math.min(READ_THIRD_STAGE_BLOCKS, totalBlocks);
}
return true;