MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / fillBuffer

Method fillBuffer

Engine/source/core/util/zip/zipSubStream.cpp:292–314  ·  view source on GitHub ↗

--------------------------------------

Source from the content-addressed store, hash-verified

290
291//--------------------------------------
292U32 ZipSubRStream::fillBuffer(const U32 in_attemptSize)
293{
294 AssertFatal(m_pStream != NULL, "No stream to fill from?");
295 AssertFatal(m_pStream->getStatus() != Stream::Closed,
296 "Fill from a closed stream?");
297
298 U32 streamSize = m_pStream->getStreamSize();
299 U32 currPos = m_pStream->getPosition();
300
301 U32 actualReadSize;
302 if (in_attemptSize + currPos > streamSize) {
303 actualReadSize = streamSize - currPos;
304 } else {
305 actualReadSize = in_attemptSize;
306 }
307
308 if (m_pStream->read(actualReadSize, m_pInputBuffer) == true) {
309 return actualReadSize;
310 } else {
311 AssertWarn(false, "Read failed while trying to fill buffer");
312 return 0;
313 }
314}
315
316
317//--------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 4

getStatusMethod · 0.45
getStreamSizeMethod · 0.45
getPositionMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected