| 375 | |
| 376 | template <typename FromType, typename ToType> |
| 377 | Status StaticCastBuffer(const Buffer& input, const int64_t length, MemoryPool* pool, |
| 378 | std::shared_ptr<Buffer>* out) { |
| 379 | ARROW_ASSIGN_OR_RAISE(auto result, AllocateBuffer(sizeof(ToType) * length, pool)); |
| 380 | |
| 381 | auto in_values = reinterpret_cast<const FromType*>(input.data()); |
| 382 | auto out_values = reinterpret_cast<ToType*>(result->mutable_data()); |
| 383 | for (int64_t i = 0; i < length; ++i) { |
| 384 | *out_values++ = static_cast<ToType>(*in_values++); |
| 385 | } |
| 386 | *out = std::move(result); |
| 387 | return Status::OK(); |
| 388 | } |
| 389 | |
| 390 | template <typename T> |
| 391 | void CopyStridedBytewise(int8_t* input_data, int64_t length, int64_t stride, |
nothing calls this directly
no test coverage detected