diff options
author | Mark Spruiell <mes@zeroc.com> | 2006-08-16 22:47:04 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2006-08-16 22:47:04 +0000 |
commit | 9fbd34278bda7d84f9773869d0ba4308ec156253 (patch) | |
tree | d988a7d329ac2643b858a7f9f01131c83992f2cc /cpp | |
parent | started the 'two threads per connection' (diff) | |
download | ice-9fbd34278bda7d84f9773869d0ba4308ec156253.tar.bz2 ice-9fbd34278bda7d84f9773869d0ba4308ec156253.tar.xz ice-9fbd34278bda7d84f9773869d0ba4308ec156253.zip |
adding zero-copy functions for sequence<byte>
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/include/Ice/Stream.h | 2 | ||||
-rw-r--r-- | cpp/src/Ice/StreamI.cpp | 12 | ||||
-rw-r--r-- | cpp/src/Ice/StreamI.h | 2 |
3 files changed, 16 insertions, 0 deletions
diff --git a/cpp/include/Ice/Stream.h b/cpp/include/Ice/Stream.h index 30785f070ae..2e8cb17ae42 100644 --- a/cpp/include/Ice/Stream.h +++ b/cpp/include/Ice/Stream.h @@ -40,6 +40,7 @@ public: virtual ::Ice::Byte readByte() = 0; virtual ::std::vector< ::Ice::Byte > readByteSeq() = 0; + virtual void readByteSeq(::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&) = 0; virtual ::Ice::Short readShort() = 0; virtual ::std::vector< ::Ice::Short > readShortSeq() = 0; @@ -93,6 +94,7 @@ public: virtual void writeByte(::Ice::Byte) = 0; virtual void writeByteSeq(const ::std::vector< ::Ice::Byte >&) = 0; + virtual void writeByteSeq(const Ice::Byte*, const Ice::Byte*) = 0; virtual void writeShort(::Ice::Short) = 0; virtual void writeShortSeq(const ::std::vector< ::Ice::Short >&) = 0; diff --git a/cpp/src/Ice/StreamI.cpp b/cpp/src/Ice/StreamI.cpp index 05cb4c44c3a..83e9dc5c226 100644 --- a/cpp/src/Ice/StreamI.cpp +++ b/cpp/src/Ice/StreamI.cpp @@ -88,6 +88,12 @@ Ice::InputStreamI::readByteSeq() return v; } +void +Ice::InputStreamI::readByteSeq(pair<const Byte*, const Byte*>& p) +{ + _is.read(p); +} + Short Ice::InputStreamI::readShort() { @@ -331,6 +337,12 @@ Ice::OutputStreamI::writeByteSeq(const vector<Byte>& v) } void +Ice::OutputStreamI::writeByteSeq(const Byte* begin, const Byte* end) +{ + _os.write(begin, end); +} + +void Ice::OutputStreamI::writeShort(Short v) { _os.write(v); diff --git a/cpp/src/Ice/StreamI.h b/cpp/src/Ice/StreamI.h index 971f3072335..701442617b8 100644 --- a/cpp/src/Ice/StreamI.h +++ b/cpp/src/Ice/StreamI.h @@ -65,6 +65,7 @@ public: virtual ::Ice::Byte readByte(); virtual ::std::vector< ::Ice::Byte > readByteSeq(); + virtual void readByteSeq(::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&); virtual ::Ice::Short readShort(); virtual ::std::vector< ::Ice::Short > readShortSeq(); @@ -131,6 +132,7 @@ public: virtual void writeByte(::Ice::Byte); virtual void writeByteSeq(const ::std::vector< ::Ice::Byte >&); + virtual void writeByteSeq(const Ice::Byte*, const Ice::Byte*); virtual void writeShort(::Ice::Short); virtual void writeShortSeq(const ::std::vector< ::Ice::Short >&); |