MCPcopy Create free account
hub / github.com/doldecomp/mkdd / readData

Method readData

libs/JSystem/JSupport/JSUFileStream.cpp:11–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9}
10
11int JSUFileInputStream::readData(void* buffer, long byteCount)
12{
13 int readBytes = 0;
14 if (((JKRFile*)mObject)->isAvailable()) {
15 if ((u32)(mLength + byteCount) > ((JKRFile*)mObject)->getFileSize()) {
16 byteCount = ((JKRFile*)mObject)->getFileSize() - mLength;
17 }
18 if (byteCount > 0) {
19 readBytes = ((JKRFile*)mObject)->readData(buffer, byteCount, mLength);
20 if (readBytes < 0) {
21 return 0;
22 } else {
23 mLength += readBytes;
24 }
25 }
26 }
27 return readBytes;
28}
29
30int JSUFileInputStream::seekPos(long offset, JSUStreamSeekFrom mode)
31{

Callers

nothing calls this directly

Calls 2

isAvailableMethod · 0.45
getFileSizeMethod · 0.45

Tested by

no test coverage detected