summaryrefslogtreecommitdiff
path: root/cs/src/Ice/BasicStream.cs
diff options
context:
space:
mode:
Diffstat (limited to 'cs/src/Ice/BasicStream.cs')
-rwxr-xr-xcs/src/Ice/BasicStream.cs20
1 files changed, 19 insertions, 1 deletions
diff --git a/cs/src/Ice/BasicStream.cs b/cs/src/Ice/BasicStream.cs
index 6ba70a56aac..0970c6a93ce 100755
--- a/cs/src/Ice/BasicStream.cs
+++ b/cs/src/Ice/BasicStream.cs
@@ -59,6 +59,7 @@ namespace IceInternal
private void initialize(IceInternal.Instance instance, bool unlimited)
{
instance_ = instance;
+ _closure = null;
_unlimited = unlimited;
allocate(1500);
_capacity = _buf.capacity();
@@ -109,11 +110,27 @@ namespace IceInternal
{
return instance_;
}
-
+
+ public virtual object closure()
+ {
+ return _closure;
+ }
+
+ public virtual object closure(object p)
+ {
+ object prev = _closure;
+ _closure = p;
+ return prev;
+ }
+
public virtual void swap(BasicStream other)
{
Debug.Assert(instance_ == other.instance_);
+ object tmpClosure = other._closure;
+ other._closure = _closure;
+ _closure = tmpClosure;
+
ByteBuffer tmpBuf = other._buf;
other._buf = _buf;
_buf = tmpBuf;
@@ -2727,6 +2744,7 @@ namespace IceInternal
}
private IceInternal.Instance instance_;
+ private object _closure;
private ByteBuffer _buf;
private int _capacity; // Cache capacity to avoid excessive method calls.
private int _limit; // Cache limit to avoid excessive method calls.