MCPcopy Create free account
hub / github.com/Illation/ETEngine / ReadChunk

Method ReadChunk

Engine/source/EtCore/FileSystem/Entry.cpp:181–195  ·  view source on GitHub ↗

--------------------------------- File::Read Read from the file

Source from the content-addressed store, hash-verified

179// Read from the file
180//
181std::vector<uint8> File::ReadChunk(uint64 const offset, uint64 const numBytes)
182{
183 ET_ASSERT(m_IsOpen);
184 ET_ASSERT(offset + numBytes <= GetSize(),
185 "Range of bytes requested exceeds file size! Offset:'%u'; Bytes:'%u'; Total:'%u'; Size:'%u'",
186 offset, numBytes, offset + numBytes, GetSize());
187
188 std::vector<uint8> content;
189 if (!FILE_BASE::ReadFile(m_Handle, content, numBytes, offset))
190 {
191 LOG("File::ReadChunk > Reading file failed", Error);
192 }
193
194 return content;
195}
196
197//---------------------------------
198// File::Write

Callers 2

GetEntryDataMethod · 0.80
LoadFileListMethod · 0.80

Calls 1

GetSizeFunction · 0.85

Tested by

no test coverage detected