WriteBlockHeader headerToSend = new WriteBlockHeader(
DataTransferProtocol.DATA_TRANSFER_VERSION, namespaceid,
block.getBlockId(), block.getGenerationStamp(), pipelineSize,
isRecovery, hasSrcDataNode, srcDataNode, targets.length - 1, targets,
client);
headerToSend.writeVersionAndOpCode(mirrorOut);
headerToSend.write(mirrorOut);
blockReceiver.writeChecksumHeader(mirrorOut);
mirrorOut.flush();
// read connect ack (only for clients, not for replication req)