summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/StreamI.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2009-04-30 14:22:37 -0230
committerDwayne Boone <dwayne@zeroc.com>2009-04-30 14:22:37 -0230
commitb742dcffcb2532742a714b9324bfcc33e63c4e44 (patch)
treef6218203f518c12230d91d55c44c7e1b6324f669 /cpp/src/Ice/StreamI.cpp
parentBug 3463 - make generated classes for slice structs non-final (diff)
downloadice-b742dcffcb2532742a714b9324bfcc33e63c4e44.tar.bz2
ice-b742dcffcb2532742a714b9324bfcc33e63c4e44.tar.xz
ice-b742dcffcb2532742a714b9324bfcc33e63c4e44.zip
Bug 3459 - add rewind/reset to InputStream/OutputStream
Diffstat (limited to 'cpp/src/Ice/StreamI.cpp')
-rw-r--r--cpp/src/Ice/StreamI.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/cpp/src/Ice/StreamI.cpp b/cpp/src/Ice/StreamI.cpp
index c0006b817c0..c347c653f5a 100644
--- a/cpp/src/Ice/StreamI.cpp
+++ b/cpp/src/Ice/StreamI.cpp
@@ -327,6 +327,13 @@ Ice::InputStreamI::readPendingObjects()
_is->readPendingObjects();
}
+void
+Ice::InputStreamI::rewind()
+{
+ _is->clear();
+ _is->i = _is->b.begin();
+}
+
//
// OutputStreamI
//
@@ -631,6 +638,23 @@ Ice::OutputStreamI::finished(vector<Byte>& bytes)
vector<Byte>(_os->b.begin(), _os->b.end()).swap(bytes);
}
+void
+Ice::OutputStreamI::reset(bool clearBuffer)
+{
+ _os->clear();
+
+ if(clearBuffer)
+ {
+ _os->b.clear();
+ }
+ else
+ {
+ _os->b.reset();
+ }
+
+ _os->i = _os->b.begin();
+}
+
//
// ObjectReader
//