diff options
author | Mark Spruiell <mes@zeroc.com> | 2012-07-11 15:43:39 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2012-07-11 15:43:39 -0700 |
commit | 4c3ad6fca3a994699b9a19021f6e17d3150dad6e (patch) | |
tree | 5f98c5d20e9e6eba4fa531f0bfc87af143d62b21 /java/src/Ice/OutputStream.java | |
parent | Don't write optionals with 1.0 encoding, added UnknownSlicedObject test, fixe... (diff) | |
download | ice-4c3ad6fca3a994699b9a19021f6e17d3150dad6e.tar.bz2 ice-4c3ad6fca3a994699b9a19021f6e17d3150dad6e.tar.xz ice-4c3ad6fca3a994699b9a19021f6e17d3150dad6e.zip |
implementing optional params in Java
Diffstat (limited to 'java/src/Ice/OutputStream.java')
-rw-r--r-- | java/src/Ice/OutputStream.java | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/java/src/Ice/OutputStream.java b/java/src/Ice/OutputStream.java index b54fc8a3f92..d921241b2f4 100644 --- a/java/src/Ice/OutputStream.java +++ b/java/src/Ice/OutputStream.java @@ -269,14 +269,7 @@ public interface OutputStream * @param tag The numeric tag associated with the value. * @param type The optional type of the value. **/ - void writeOptional(int tag, Ice.OptionalType type); - - /** - * Indicates that marshaling of a request or reply is finished. - * - * @return The byte sequence containing the encoded request or reply. - **/ - byte[] finished(); + boolean writeOptional(int tag, Ice.OptionalType type); /** * Determines the current position in the stream. @@ -294,6 +287,25 @@ public interface OutputStream void rewrite(int sz, int pos); /** + * Records the current position and allocates four bytes for a fixed-length (32-bit) + * size value. + **/ + void startSize(); + + /** + * Computes the amount of data written since the previous call to startSize and + * writes that value at the saved position. + **/ + void endSize(); + + /** + * Indicates that marshaling of a request or reply is finished. + * + * @return The byte sequence containing the encoded request or reply. + **/ + byte[] finished(); + + /** * Resets this output stream. This method allows the stream to be reused, to avoid creating * unnecessary garbage. * |