| 192 | |
| 193 | template <typename T> |
| 194 | void readValues( |
| 195 | ByteInputStream* source, |
| 196 | vector_size_t size, |
| 197 | vector_size_t offset, |
| 198 | BufferPtr nulls, |
| 199 | vector_size_t nullCount, |
| 200 | BufferPtr values) { |
| 201 | if (nullCount) { |
| 202 | auto rawValues = values->asMutable<T>(); |
| 203 | int32_t toClear = offset; |
| 204 | bits::forEachSetBit( |
| 205 | nulls->as<uint64_t>(), offset, offset + size, [&](int32_t row) { |
| 206 | // Set the values between the last non-null and this to type default. |
| 207 | for (; toClear < row; ++toClear) { |
| 208 | rawValues[toClear] = T(); |
| 209 | } |
| 210 | rawValues[row] = source->read<T>(); |
| 211 | toClear = row + 1; |
| 212 | }); |
| 213 | } else { |
| 214 | source->readBytes( |
| 215 | values->asMutable<uint8_t>() + offset * sizeof(T), size * sizeof(T)); |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | template <> |
| 220 | void readValues<bool>( |
nothing calls this directly
no test coverage detected