diff options
author | Benoit Foucher <benoit@zeroc.com> | 2013-01-23 14:36:10 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2013-01-23 14:36:10 +0100 |
commit | 66bf1a7f2d0d46281ebf3d62caab6b9158eaa8a0 (patch) | |
tree | bd6aca447179f8d2e586c12cb961d683552504be /cpp/src/slice2freezej/Main.cpp | |
parent | Minor code style fixes (diff) | |
download | ice-66bf1a7f2d0d46281ebf3d62caab6b9158eaa8a0.tar.bz2 ice-66bf1a7f2d0d46281ebf3d62caab6b9158eaa8a0.tar.xz ice-66bf1a7f2d0d46281ebf3d62caab6b9158eaa8a0.zip |
Fix for ICE-4841 - added no copy option when creating input stream
Diffstat (limited to 'cpp/src/slice2freezej/Main.cpp')
-rw-r--r-- | cpp/src/slice2freezej/Main.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/cpp/src/slice2freezej/Main.cpp b/cpp/src/slice2freezej/Main.cpp index 183d262b92e..49c0514a2ae 100644 --- a/cpp/src/slice2freezej/Main.cpp +++ b/cpp/src/slice2freezej/Main.cpp @@ -930,16 +930,11 @@ FreezeGenerator::generate(UnitPtr& u, const Dict& dict) << "(byte[] b, Ice.Communicator communicator, Ice.EncodingVersion encoding)"; out << sb; out << nl << "IceInternal.BasicStream __is = " - << "new IceInternal.BasicStream(IceInternal.Util.getInstance(communicator), encoding, true, false);"; + << "new IceInternal.BasicStream(IceInternal.Util.getInstance(communicator), encoding, b);"; if(type->usesClasses()) { out << nl << "__is.sliceObjects(false);"; } - out << nl << "__is.resize(b.length, true);"; - out << nl << "IceInternal.Buffer __buf = __is.getBuffer();"; - out << nl << "__buf.b.position(0);"; - out << nl << "__buf.b.put(b);"; - out << nl << "__buf.b.position(0);"; if(encaps) { out << nl << "__is.startReadEncaps();"; @@ -1101,12 +1096,7 @@ FreezeGenerator::generate(UnitPtr& u, const Dict& dict) else { out << nl << "IceInternal.BasicStream __is = " - << "new IceInternal.BasicStream(IceInternal.Util.getInstance(communicator), encoding, true, false);"; - out << nl << "__is.resize(bytes.length, true);"; - out << nl << "IceInternal.Buffer buf = __is.getBuffer();"; - out << nl << "buf.b.position(0);"; - out << nl << "buf.b.put(bytes);"; - out << nl << "buf.b.position(0);"; + << "new IceInternal.BasicStream(IceInternal.Util.getInstance(communicator), encoding, bytes);"; int iter = 0; list<string> metaData; |