| 234 | { |
| 235 | public: |
| 236 | FileEncoder(int_fd _fd, size_t _size) |
| 237 | : fd(_fd), size(static_cast<off_t>(_size)), index(0) |
| 238 | { |
| 239 | // NOTE: For files, we expect the size to be derived from `stat`-ing |
| 240 | // the file. The `struct stat` returns the size in `off_t` form, |
| 241 | // meaning that it is a programmer error to construct the `FileEncoder` |
| 242 | // with a size greater the max value of `off_t`. |
| 243 | CHECK_LE(_size, static_cast<size_t>(std::numeric_limits<off_t>::max())); |
| 244 | } |
| 245 | |
| 246 | ~FileEncoder() override |
| 247 | { |
nothing calls this directly
no outgoing calls
no test coverage detected