Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'source/core')
-rw-r--r--source/core/StarDataStream.cpp4
-rw-r--r--source/core/StarDataStreamDevices.cpp7
-rw-r--r--source/core/StarDataStreamDevices.hpp3
3 files changed, 12 insertions, 2 deletions
diff --git a/source/core/StarDataStream.cpp b/source/core/StarDataStream.cpp
index c8d50a4..834f4de 100644
--- a/source/core/StarDataStream.cpp
+++ b/source/core/StarDataStream.cpp
@@ -205,7 +205,7 @@ size_t DataStream::readVlqU(uint64_t& i) {
size_t bytesRead = Star::readVlqU(i, makeFunctionInputIterator([this]() { return this->read<uint8_t>(); }));
if (bytesRead == NPos)
- throw DataStreamException("Error reading VLQ encoded intenger!");
+ throw DataStreamException("Error reading VLQ encoded integer!");
return bytesRead;
}
@@ -214,7 +214,7 @@ size_t DataStream::readVlqI(int64_t& i) {
size_t bytesRead = Star::readVlqI(i, makeFunctionInputIterator([this]() { return this->read<uint8_t>(); }));
if (bytesRead == NPos)
- throw DataStreamException("Error reading VLQ encoded intenger!");
+ throw DataStreamException("Error reading VLQ encoded integer!");
return bytesRead;
}
diff --git a/source/core/StarDataStreamDevices.cpp b/source/core/StarDataStreamDevices.cpp
index 0c37d8d..85e6d3f 100644
--- a/source/core/StarDataStreamDevices.cpp
+++ b/source/core/StarDataStreamDevices.cpp
@@ -164,4 +164,11 @@ void DataStreamExternalBuffer::reset(char const* externalData, size_t len) {
m_buffer.reset(externalData, len);
}
+void DataStreamExternalBuffer::readData(char* data, size_t len) {
+ m_buffer.readFull(data, len);
+}
+void DataStreamExternalBuffer::writeData(char const* data, size_t len) {
+ m_buffer.writeFull(data, len);
+}
+
}
diff --git a/source/core/StarDataStreamDevices.hpp b/source/core/StarDataStreamDevices.hpp
index 88ee0e9..4a12d24 100644
--- a/source/core/StarDataStreamDevices.hpp
+++ b/source/core/StarDataStreamDevices.hpp
@@ -140,6 +140,9 @@ public:
void reset(char const* externalData, size_t len);
+ void readData(char* data, size_t len) override;
+ void writeData(char const* data, size_t len) override;
+
private:
ExternalBuffer m_buffer;
};