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 /java/src/Ice/Util.java | |
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 'java/src/Ice/Util.java')
-rw-r--r-- | java/src/Ice/Util.java | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/java/src/Ice/Util.java b/java/src/Ice/Util.java index 328aee186fa..049d82f0e7f 100644 --- a/java/src/Ice/Util.java +++ b/java/src/Ice/Util.java @@ -440,7 +440,7 @@ public final class Util public static InputStream createInputStream(Communicator communicator, byte[] bytes) { - return new InputStreamI(communicator, bytes); + return createInputStream(communicator, bytes, true); } /** @@ -455,7 +455,40 @@ public final class Util public static InputStream createInputStream(Communicator communicator, byte[] bytes, EncodingVersion v) { - return new InputStreamI(communicator, bytes, v); + return createInputStream(communicator, bytes, v, true); + } + + /** + * Creates an input stream for dynamic invocation and dispatch. The stream uses + * the communicator's default encoding version. + * + * @param communicator The communicator for the stream. + * @param bytes An encoded request or reply. + * @param copyBytes True if the given bytes should be copied, + * false otherwise. + * @return The input stream. + **/ + public static InputStream + createInputStream(Communicator communicator, byte[] bytes, boolean copyBytes) + { + return new InputStreamI(communicator, bytes, copyBytes); + } + + /** + * Creates an input stream for dynamic invocation and dispatch. The stream uses + * the given encoding version. + * + * @param communicator The communicator for the stream. + * @param bytes An encoded request or reply. + * @param v The desired encoding version. + * @param copyBytes True if the given bytes should be copied, + * false otherwise. + * @return The input stream. + **/ + public static InputStream + createInputStream(Communicator communicator, byte[] bytes, EncodingVersion v, boolean copyBytes) + { + return new InputStreamI(communicator, bytes, v, copyBytes); } /** |