summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/BasicStream.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2006-02-10 13:15:28 +0000
committerDwayne Boone <dwayne@zeroc.com>2006-02-10 13:15:28 +0000
commit75b0b75699c3e46c27bafc0fe8c9c9419aec4f00 (patch)
tree4ab90f49cd0c4166137cbc891c9a0d1fbe64661f /cpp/src/Ice/BasicStream.cpp
parentFixed path for slice2cpp.exe (diff)
downloadice-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.cpp19
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);