17 std::vector<std::uint8_t>
data;
64 virtual std::vector<std::uint8_t>
read(std::uint64_t
offset, std::uint64_t length) = 0;
68 virtual void read_batch(std::vector<RangeRequest>& requests);
77 std::vector<std::uint8_t>
read(std::uint64_t
offset, std::uint64_t length)
override;
81 std::ifstream stream_;
100 std::vector<std::uint8_t>
read(std::uint64_t
offset, std::uint64_t length)
override;
101 void read_batch(std::vector<RangeRequest>& requests)
override;
106 bool covers(std::uint64_t
offset, std::uint64_t length)
const;
108 std::uint64_t clamped_fetch(std::uint64_t
offset, std::uint64_t length);
109 std::vector<std::uint8_t> slice_from_buffer(std::uint64_t
offset, std::uint64_t length)
const;
111 std::shared_ptr<RangeReader> inner_;
112 std::uint64_t min_req_size_;
113 std::uint64_t buf_offset_ = 0;
114 std::vector<std::uint8_t> buf_;
Caching decorator: over-fetches to min_req_size and serves subsequent reads inside the cached window ...
void read_batch(std::vector< RangeRequest > &requests) override
Fill every request, preserving order.
std::vector< std::uint8_t > read(std::uint64_t offset, std::uint64_t length) override
Read length bytes at offset, subject to the contract above.
std::uint64_t total_size() override
Total byte length of the resource.
std::uint64_t total_size() override
Total byte length of the resource.
std::vector< std::uint8_t > read(std::uint64_t offset, std::uint64_t length) override
Read length bytes at offset, subject to the contract above.
Synchronous byte-range source.
virtual std::uint64_t total_size()=0
Total byte length of the resource.
virtual ~RangeReader()=default
virtual void read_batch(std::vector< RangeRequest > &requests)
Fill every request, preserving order.
virtual std::vector< std::uint8_t > read(std::uint64_t offset, std::uint64_t length)=0
Read length bytes at offset, subject to the contract above.
One range in a batched read. data is filled in place by read_batch().
std::vector< std::uint8_t > data