void ReadDecimal(ignite::impl::binary::BinaryReaderImpl& reader, common::Decimal& decimal) { int8_t hdr = reader.ReadInt8(); assert(hdr == ignite::impl::binary::IGNITE_TYPE_DECIMAL); int32_t scale = reader.ReadInt32(); int32_t len = reader.ReadInt32(); std::vector<int8_t> mag; mag.resize(len); impl::binary::BinaryUtils::ReadInt8Array(reader.GetStream(), mag.data(), static_cast<int32_t>(mag.size())); int32_t sign = 1; if (mag[0] < 0) { mag[0] &= 0x7F; sign = -1; } common::Decimal res(mag.data(), static_cast<int32_t>(mag.size()), scale, sign); decimal.Swap(res); }
void ResultPage::Read(ignite::impl::binary::BinaryReaderImpl& reader) { last = reader.ReadBool(); size = reader.ReadInt32(); ignite::impl::interop::InteropInputStream& stream = *reader.GetStream(); int32_t dataToRead = stream.Remaining(); data.Length(dataToRead); if (dataToRead) { data.Reallocate(dataToRead); reader.GetStream()->ReadInt8Array(data.Data(), dataToRead); } }