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

Function ValidateWriteRange

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

Source from the content-addressed store, hash-verified

307}
308
309Status ValidateWriteRange(int64_t offset, int64_t size, int64_t file_size) {
310 if (offset < 0 || size < 0) {
311 return Status::Invalid("Invalid write (offset = ", offset, ", size = ", size, ")");
312 }
313 if (offset + size > file_size) {
314 return Status::IOError("Write out of bounds (offset = ", offset, ", size = ", size,
315 ") in file of size ", file_size);
316 }
317 return Status::OK();
318}
319
320Status ValidateRange(int64_t offset, int64_t size) {
321 if (offset < 0 || size < 0) {

Callers 4

WriteMethod · 0.85
WriteAtMethod · 0.85
WriteAtMethod · 0.85
WriteMethod · 0.85

Calls 3

IOErrorFunction · 0.85
InvalidFunction · 0.50
OKFunction · 0.50

Tested by

no test coverage detected