| 302 | |
| 303 | template <class TCounter> |
| 304 | static inline TBlob ReadFromFile(const TFile& file, ui64 offset, size_t length) { |
| 305 | using TBase = TDynamicBlobBase<TCounter>; |
| 306 | THolder<TBase> base(new (length) TBase); |
| 307 | |
| 308 | Y_ASSERT(base->Length() == length); |
| 309 | |
| 310 | file.Pload(base->Data(), length, offset); |
| 311 | |
| 312 | TBlob ret(base->Data(), length, base.Get()); |
| 313 | Y_UNUSED(base.Release()); |
| 314 | |
| 315 | return ret; |
| 316 | } |
| 317 | |
| 318 | template <class TCounter> |
| 319 | static inline TBlob ConstructFromFileContent(const TFile& file, ui64 offset, ui64 length) { |