| 176 | } |
| 177 | |
| 178 | Result<int64_t> Read(int64_t nbytes, void* buffer) { |
| 179 | RETURN_NOT_OK(CheckClosed()); |
| 180 | |
| 181 | int64_t total_bytes = 0; |
| 182 | while (total_bytes < nbytes) { |
| 183 | tSize ret = driver_->Read( |
| 184 | fs_, file_, reinterpret_cast<uint8_t*>(buffer) + total_bytes, |
| 185 | static_cast<tSize>(std::min<int64_t>(buffer_size_, nbytes - total_bytes))); |
| 186 | CHECK_FAILURE(ret, "read"); |
| 187 | total_bytes += ret; |
| 188 | if (ret == 0) { |
| 189 | break; |
| 190 | } |
| 191 | } |
| 192 | return total_bytes; |
| 193 | } |
| 194 | |
| 195 | Result<std::shared_ptr<Buffer>> Read(int64_t nbytes) { |
| 196 | RETURN_NOT_OK(CheckClosed()); |
nothing calls this directly
no test coverage detected