MCPcopy Create free account
hub / github.com/IENT/YUView / readBytes

Method readBytes

YUViewLib/src/filesource/FileSource.cpp:87–97  ·  view source on GitHub ↗

Resize the target array if necessary and read the given number of bytes to the data array

Source from the content-addressed store, hash-verified

85#if SSE_CONVERSION
86// Resize the target array if necessary and read the given number of bytes to the data array
87void FileSource::readBytes(byteArrayAligned &targetBuffer, int64_t startPos, int64_t nrBytes)
88{
89 if (!isOk())
90 return;
91
92 if (targetBuffer.size() < nrBytes)
93 targetBuffer.resize(nrBytes);
94
95 srcFile.seek(startPos);
96 srcFile.read(targetBuffer.data(), nrBytes);
97}
98#endif
99
100// Resize the target array if necessary and read the given number of bytes to the data array

Calls 5

isOkMethod · 0.95
resizeMethod · 0.80
sizeMethod · 0.45
seekMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected