summaryrefslogtreecommitdiff
path: root/java/src
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2016-05-09 23:31:16 +0200
committerJose <jose@zeroc.com>2016-05-09 23:31:16 +0200
commit464ac5419aba884ee1783f5f67286a3c7aa72d3e (patch)
tree75d53a81f5972f7969998bd40aa21c1ec26ed672 /java/src
parentMerge remote-tracking branch 'origin/3.6' (diff)
downloadice-464ac5419aba884ee1783f5f67286a3c7aa72d3e.tar.bz2
ice-464ac5419aba884ee1783f5f67286a3c7aa72d3e.tar.xz
ice-464ac5419aba884ee1783f5f67286a3c7aa72d3e.zip
Conflict fixes from previous commit
Diffstat (limited to 'java/src')
-rw-r--r--java/src/Ice/src/main/java/Ice/InputStream.java26
1 files changed, 16 insertions, 10 deletions
diff --git a/java/src/Ice/src/main/java/Ice/InputStream.java b/java/src/Ice/src/main/java/Ice/InputStream.java
index b203520718b..8c1d23465d3 100644
--- a/java/src/Ice/src/main/java/Ice/InputStream.java
+++ b/java/src/Ice/src/main/java/Ice/InputStream.java
@@ -634,28 +634,34 @@ public class InputStream
*
* @param encoding The encapsulation's encoding version.
**/
- public void skipEmptyEncapsulation(EncodingVersion encoding)
+ public Ice.EncodingVersion skipEmptyEncapsulation()
{
int sz = readInt();
- if(sz != 6)
+ if(sz < 6)
{
- throw new EncapsulationException();
+ throw new Ice.EncapsulationException();
}
-
- final int pos = _buf.b.position();
- if(pos + 2 > _buf.size())
+ if(sz - 4 > _buf.b.remaining())
{
- throw new UnmarshalOutOfBoundsException();
+ throw new Ice.UnmarshalOutOfBoundsException();
}
- if(encoding != null)
+ Ice.EncodingVersion encoding = new Ice.EncodingVersion();
+ encoding.ice_read(this);
+ if(encoding.equals(Ice.Util.Encoding_1_0))
{
- encoding.ice_read(this);
+ if(sz != 6)
+ {
+ throw new Ice.EncapsulationException();
+ }
}
else
{
- _buf.b.position(pos + 2);
+ // Skip the optional content of the encapsulation if we are expecting an
+ // empty encapsulation.
+ _buf.b.position(_buf.b.position() + sz - 6);
}
+ return encoding;
}
/**