| 3 | #include "chunked_helpers.h" |
| 4 | |
| 5 | TBlob GetBlock(const TBlob& blob, size_t index) { |
| 6 | TChunkedDataReader reader(blob); |
| 7 | if (index >= reader.GetBlocksCount()) |
| 8 | ythrow yexception() << "index " << index << " is >= than block count " << reader.GetBlocksCount(); |
| 9 | size_t begin = (const char*)reader.GetBlock(index) - (const char*)blob.Data(); |
| 10 | return blob.SubBlob(begin, begin + reader.GetBlockLen(index)); |
| 11 | } |
| 12 | |
| 13 | /*************************** TNamedChunkedDataReader ***************************/ |
| 14 |