AppendBlockHeader headerToSend = new AppendBlockHeader(
versionAndOpcode.getDataTransferVersion(), namespaceid,
block.getBlockId(), block.getNumBytes(), block.getGenerationStamp(), pipelineSize,
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)