diff options
author | Benoit Foucher <benoit@zeroc.com> | 2013-01-28 11:18:25 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2013-01-28 11:18:25 +0100 |
commit | 505c27be641d9855aa682affb204f118b1ce69f1 (patch) | |
tree | 406d1323320961802695285315ce6f72cce6447a /cpp/src/Ice/StreamI.cpp | |
parent | ICE-5191: support for zero-copy on x86_64 (diff) | |
download | ice-505c27be641d9855aa682affb204f118b1ce69f1.tar.bz2 ice-505c27be641d9855aa682affb204f118b1ce69f1.tar.xz ice-505c27be641d9855aa682affb204f118b1ce69f1.zip |
ICE-5198: zero-copy OutputStream::finished method
Diffstat (limited to 'cpp/src/Ice/StreamI.cpp')
-rw-r--r-- | cpp/src/Ice/StreamI.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cpp/src/Ice/StreamI.cpp b/cpp/src/Ice/StreamI.cpp index 04e616c0a49..08487647785 100644 --- a/cpp/src/Ice/StreamI.cpp +++ b/cpp/src/Ice/StreamI.cpp @@ -671,6 +671,19 @@ OutputStreamI::finished(vector<Byte>& bytes) vector<Byte>(_os->b.begin(), _os->b.end()).swap(bytes); } +pair<const Byte*, const Byte*> +OutputStreamI::finished() +{ + if(_os->b.empty()) + { + return pair<const Byte*, const Byte*>(reinterpret_cast<Ice::Byte*>(0), reinterpret_cast<Ice::Byte*>(0)); + } + else + { + return pair<const Byte*, const Byte*>(&_os->b[0], &_os->b[0] + _os->b.size()); + } +} + void OutputStreamI::reset(bool clearBuffer) { |