| 144 | } |
| 145 | |
| 146 | uint64_t At4Block::Read(std::streambuf& buffer) { |
| 147 | uint64_t bytes = ReadHeader4(buffer); |
| 148 | bytes += ReadNumber(buffer, flags_); |
| 149 | bytes += ReadNumber(buffer, creator_index_); |
| 150 | std::vector<uint8_t> reserved; |
| 151 | bytes += ReadByte(buffer, reserved, 4); |
| 152 | bytes += ReadByte(buffer, md5_, 16); |
| 153 | bytes += ReadNumber(buffer, original_size_); |
| 154 | bytes += ReadNumber(buffer, nof_bytes_); |
| 155 | // Do not read in the data BLOB at this point but store the file position for |
| 156 | // that data, so it is fast to get the data later |
| 157 | data_position_ = GetFilePosition(buffer); |
| 158 | |
| 159 | filename_ = ReadTx4(buffer, kIndexFilename); |
| 160 | file_type_ = ReadTx4(buffer, kIndexType); |
| 161 | ReadMdComment(buffer, kIndexMd); |
| 162 | |
| 163 | return bytes; |
| 164 | } |
| 165 | |
| 166 | uint64_t At4Block::Write(std::streambuf& buffer) { |
| 167 | const bool update = FilePosition() > 0; |
nothing calls this directly
no test coverage detected