diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2009-04-30 14:22:37 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2009-04-30 14:22:37 -0230 |
commit | b742dcffcb2532742a714b9324bfcc33e63c4e44 (patch) | |
tree | f6218203f518c12230d91d55c44c7e1b6324f669 /cpp/src/Ice/StreamI.cpp | |
parent | Bug 3463 - make generated classes for slice structs non-final (diff) | |
download | ice-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.cpp | 24 |
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 // |