| 54 | } |
| 55 | |
| 56 | uint64_t Dz4Block::Write(std::streambuf& buffer) { |
| 57 | const bool update = FilePosition() > 0; |
| 58 | if (update) { |
| 59 | // The DZ block properties cannot be changed after it has been written |
| 60 | return block_length_; |
| 61 | } |
| 62 | |
| 63 | block_type_ = "##DZ"; |
| 64 | link_list_.clear(); |
| 65 | block_length_ = 24 + 2 + 1 + 1 + 4 + 8 + 8 + data_length_; |
| 66 | |
| 67 | uint64_t bytes = MdfBlock::Write(buffer); |
| 68 | bytes += WriteStr(buffer, orig_block_type_, 2); |
| 69 | bytes += WriteNumber(buffer, type_); |
| 70 | bytes += WriteBytes(buffer, 1); |
| 71 | bytes += WriteNumber(buffer, parameter_); |
| 72 | bytes += WriteNumber(buffer, orig_data_length_); |
| 73 | bytes += WriteNumber(buffer, data_length_); |
| 74 | bytes += WriteByte(buffer,data_); |
| 75 | UpdateBlockSize(buffer, bytes); |
| 76 | |
| 77 | return bytes; |
| 78 | } |
| 79 | |
| 80 | uint64_t Dz4Block::CopyDataToFile(std::streambuf& from_file, |
| 81 | std::streambuf& to_file) const { |
nothing calls this directly
no test coverage detected