| 216 | std::ios_base::out)) {} |
| 217 | |
| 218 | Status Append(StringPiece data) override { |
| 219 | if (!outfile_) { |
| 220 | return errors::FailedPrecondition( |
| 221 | "The internal temporary file is not writable."); |
| 222 | } |
| 223 | sync_needed_ = true; |
| 224 | outfile_->write(data.data(), data.size()); |
| 225 | if (!outfile_->good()) { |
| 226 | return errors::Internal( |
| 227 | "Could not append to the internal temporary file."); |
| 228 | } |
| 229 | return Status::OK(); |
| 230 | } |
| 231 | |
| 232 | Status Close() override { |
| 233 | if (outfile_) { |