summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/FileTransfer/ByteArrayReadBytestream.h')
-rw-r--r--Swiften/FileTransfer/ByteArrayReadBytestream.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Swiften/FileTransfer/ByteArrayReadBytestream.h b/Swiften/FileTransfer/ByteArrayReadBytestream.h
index 4704db6..a6945c3 100644
--- a/Swiften/FileTransfer/ByteArrayReadBytestream.h
+++ b/Swiften/FileTransfer/ByteArrayReadBytestream.h
@@ -16,18 +16,20 @@ namespace Swift {
ByteArrayReadBytestream(const std::vector<unsigned char>& data) : data(data), position(0) {
}
virtual std::vector<unsigned char> read(size_t size) {
size_t readSize = size;
if (position + readSize > data.size()) {
readSize = data.size() - position;
}
std::vector<unsigned char> result(data.begin() + position, data.begin() + position + readSize);
+
+ onRead(result);
position += readSize;
return result;
}
virtual bool isFinished() const {
return position >= data.size();
}
private: