MCPcopy Create free account
hub / github.com/bytedance/bolt / readBytes

Method readBytes

bolt/common/memory/ByteStream.cpp:145–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145void ByteInputStream::readBytes(uint8_t* bytes, int32_t size) {
146 int32_t offset = 0;
147 for (;;) {
148 int32_t available = current_->size - current_->position;
149 int32_t numUsed = std::min(available, size);
150 simd::memcpy(
151 bytes + offset, current_->buffer + current_->position, numUsed);
152 offset += numUsed;
153 size -= numUsed;
154 current_->position += numUsed;
155 if (!size) {
156 return;
157 }
158 next();
159 }
160}
161
162std::string_view ByteInputStream::nextView(int32_t size) {
163 if (current_->position == current_->size) {

Callers 15

ReadMethod · 0.45
deserializeMethod · 0.45
readValuesFunction · 0.45
readNullsFunction · 0.45
read<StringView>Function · 0.45
readDictionaryVectorFunction · 0.45
readLengthPrefixedStringFunction · 0.45
deserializeMethod · 0.45
nextBatchMethod · 0.45
deserializeVariantFunction · 0.45
readVariantStringViewFunction · 0.45
deserializeMethod · 0.45

Calls 2

memcpyFunction · 0.85
minFunction · 0.50

Tested by

no test coverage detected