| 42 | //----------------------------------------------------------------------------- |
| 43 | |
| 44 | U32 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 |
nothing calls this directly
no test coverage detected