diff options
Diffstat (limited to 'java/src/IceInternal/BasicStream.java')
-rw-r--r-- | java/src/IceInternal/BasicStream.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/java/src/IceInternal/BasicStream.java b/java/src/IceInternal/BasicStream.java index 372b9875f33..2b15bdd6897 100644 --- a/java/src/IceInternal/BasicStream.java +++ b/java/src/IceInternal/BasicStream.java @@ -27,6 +27,7 @@ public class BasicStream initialize(IceInternal.Instance instance, boolean unlimited) { _instance = instance; + _closure = null; _unlimited = unlimited; allocate(1500); _capacity = _buf.capacity(); @@ -80,11 +81,29 @@ public class BasicStream return _instance; } + public Object + closure() + { + return _closure; + } + + public Object + closure(Object p) + { + Object prev = _closure; + _closure = p; + return prev; + } + public void swap(BasicStream other) { assert(_instance == other._instance); + Object tmpClosure = other._closure; + other._closure = _closure; + _closure = tmpClosure; + java.nio.ByteBuffer tmpBuf = other._buf; other._buf = _buf; _buf = tmpBuf; @@ -2294,6 +2313,7 @@ public class BasicStream } private IceInternal.Instance _instance; + private Object _closure; private java.nio.ByteBuffer _buf; private int _capacity; // Cache capacity to avoid excessive method calls. private int _limit; // Cache limit to avoid excessive method calls. |