code: public void write(DataOutput out) throws IOException {
      InjectionHandler.processEvent(InjectionEvent.READ_BLOCK_HEAD_BEFORE_WRITE);
      
      if (getDataTransferVersion() >= DataTransferProtocol.FEDERATION_VERSION) {
        out.writeInt(namespaceId);
      }
      out.writeLong(blockId);
      out.writeLong(genStamp);
      out.writeLong(startOffset);
      out.writeLong(len);
      Text.writeString(out, clientName);
      if (getDataTransferVersion() >= DataTransferProtocol.READ_REUSE_CONNECTION_VERSION) {
        out.writeBoolean(reuseConnection);
      }
      
      if (getDataTransferVersion() >= DataTransferProtocol.READ_PROFILING_VERSION) {
        out.writeBoolean(shouldProfile);
      }
      if (getDataTransferVersion() >= DataTransferProtocol.BITSETOPTIONS_READ_VERSION) {
        options.write(out);
      }
    }
docs: ///////////////////////////////////