| 1525 | } |
| 1526 | |
| 1527 | Status CheckPosition(int64_t position, const char* action) const { |
| 1528 | if (position < 0) { |
| 1529 | return Status::Invalid("Cannot ", action, " from negative position"); |
| 1530 | } |
| 1531 | if (position > content_length_) { |
| 1532 | return Status::IOError("Cannot ", action, " past end of file"); |
| 1533 | } |
| 1534 | return Status::OK(); |
| 1535 | } |
| 1536 | |
| 1537 | // RandomAccessFile APIs |
| 1538 |