MCPcopy Create free account
hub / github.com/apache/arrow / ValidateReadRange

Function ValidateReadRange

cpp/src/arrow/io/interfaces.cc:298–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296}
297
298Result<int64_t> ValidateReadRange(int64_t offset, int64_t size, int64_t file_size) {
299 if (offset < 0 || size < 0) {
300 return Status::Invalid("Invalid read (offset = ", offset, ", size = ", size, ")");
301 }
302 if (offset > file_size) {
303 return Status::IOError("Read out of bounds (offset = ", offset, ", size = ", size,
304 ") in file of size ", file_size);
305 }
306 return std::min(size, file_size - offset);
307}
308
309Status ValidateWriteRange(int64_t offset, int64_t size, int64_t file_size) {
310 if (offset < 0 || size < 0) {

Callers 2

DoReadAtMethod · 0.85
ReadAtMethod · 0.85

Calls 2

IOErrorFunction · 0.85
InvalidFunction · 0.50

Tested by

no test coverage detected