diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2006-02-10 13:15:28 +0000 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2006-02-10 13:15:28 +0000 |
commit | 75b0b75699c3e46c27bafc0fe8c9c9419aec4f00 (patch) | |
tree | 4ab90f49cd0c4166137cbc891c9a0d1fbe64661f /cpp/src/Ice/BasicStream.cpp | |
parent | Fixed path for slice2cpp.exe (diff) | |
download | ice-75b0b75699c3e46c27bafc0fe8c9c9419aec4f00.tar.bz2 ice-75b0b75699c3e46c27bafc0fe8c9c9419aec4f00.tar.xz ice-75b0b75699c3e46c27bafc0fe8c9c9419aec4f00.zip |
Added zero copy readBlob
Diffstat (limited to 'cpp/src/Ice/BasicStream.cpp')
-rw-r--r-- | cpp/src/Ice/BasicStream.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/cpp/src/Ice/BasicStream.cpp b/cpp/src/Ice/BasicStream.cpp index fb764309bb0..c81d2aa552f 100644 --- a/cpp/src/Ice/BasicStream.cpp +++ b/cpp/src/Ice/BasicStream.cpp @@ -705,6 +705,25 @@ IceInternal::BasicStream::readBlob(Ice::Byte* v, Container::size_type sz) } void +IceInternal::BasicStream::readBlob(pair<const Byte*, const Byte*>& v, Int sz) +{ + if(sz > 0) + { + if(b.end() - i < sz) + { + throw UnmarshalOutOfBoundsException(__FILE__, __LINE__); + } + v.first = i; + v.second = i + sz; + i += sz; + } + else + { + v.first = v.second = 0; + } +} + +void IceInternal::BasicStream::write(const Byte* begin, const Byte* end) { Int sz = static_cast<Int>(end - begin); |