void ArgumentEncoder::encodeVariableLengthByteArray(const DataReference& dataReference) { // Encode the size. encodeUInt64(static_cast<uint64_t>(dataReference.size())); encodeFixedLengthData(dataReference.data(), dataReference.size(), 1); }
HistoryEntryDataEncoder& operator<<(const Vector<char>& value) { *this << static_cast<uint64_t>(value.size()); encodeFixedLengthData(reinterpret_cast<const uint8_t*>(value.data()), value.size(), 1); return *this; }
HistoryEntryDataEncoder& encodeArithmeticType(Type value) { static_assert(std::is_arithmetic<Type>::value, ""); encodeFixedLengthData(reinterpret_cast<uint8_t*>(&value), sizeof(value), sizeof(value)); return *this; }
HistoryEntryDataEncoder& operator<<(const String& value) { // Special case the null string. if (value.isNull()) return *this << std::numeric_limits<uint32_t>::max(); uint32_t length = value.length(); *this << length; *this << static_cast<uint64_t>(length * sizeof(UChar)); encodeFixedLengthData(reinterpret_cast<const uint8_t*>(StringView(value).upconvertedCharacters().get()), length * sizeof(UChar), alignof(UChar)); return *this; }