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

Method fillBuffer

Engine/source/core/util/zip/zipCryptStream.cpp:44–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42//-----------------------------------------------------------------------------
43
44U32 ZipCryptRStream::fillBuffer(const U32 in_attemptSize, void *pBuffer)
45{
46 AssertFatal(mStream != NULL, "No stream to fill from?");
47 AssertFatal(mStream->getStatus() != Stream::Closed,
48 "Fill from a closed stream?");
49
50 U32 currPos = mStream->getPosition();
51
52 U32 actualReadSize;
53 if (in_attemptSize + currPos > mFileEndPos) {
54 actualReadSize = mFileEndPos - currPos;
55 } else {
56 actualReadSize = in_attemptSize;
57 }
58
59 if (mStream->read(actualReadSize, pBuffer) == true) {
60 return actualReadSize;
61 } else {
62 AssertWarn(false, "Read failed while trying to fill buffer");
63 return 0;
64 }
65}
66
67//-----------------------------------------------------------------------------
68// Public Methods

Callers

nothing calls this directly

Calls 3

getStatusMethod · 0.45
getPositionMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected