MCPcopy Create free account
hub / github.com/Tencent/libpag / readByteData

Method readByteData

src/codec/utils/DecodeStream.cpp:143–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143std::unique_ptr<ByteData> DecodeStream::readByteData() {
144 auto length = readEncodedUint32();
145 auto bytes = readBytes(length);
146 // must check whether the byte data is valid. otherwise, memcpy() will crash.
147 if (length == 0 || length > bytes.length() || context->hasException()) {
148 return nullptr;
149 }
150 return ByteData::MakeCopy(bytes.data(), length);
151}
152
153std::string DecodeStream::readUTF8String() {
154 if (_position < dataView.size()) {

Callers 5

ReadImageBytesFunction · 0.80
ReadImageBytesV2Function · 0.80
ReadBitmapSequenceFunction · 0.80
ReadAudioBytesFunction · 0.80
ReadImageBytesV3Function · 0.80

Calls 3

hasExceptionMethod · 0.80
lengthMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected