--------------------------------------
| 290 | |
| 291 | //-------------------------------------- |
| 292 | U32 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 | //-------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected