diff options
author | Mark Spruiell <mes@zeroc.com> | 2002-01-03 21:55:36 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2002-01-03 21:55:36 +0000 |
commit | aab366f5238bcb4e00dfc40ea127dd6415e26749 (patch) | |
tree | c8668bc729fb6c795e8da1ecc22427b652462aef /java/src/IceInternal/BasicStream.java | |
parent | update dependencies. (diff) | |
download | ice-aab366f5238bcb4e00dfc40ea127dd6415e26749.tar.bz2 ice-aab366f5238bcb4e00dfc40ea127dd6415e26749.tar.xz ice-aab366f5238bcb4e00dfc40ea127dd6415e26749.zip |
server fixes
Diffstat (limited to 'java/src/IceInternal/BasicStream.java')
-rw-r--r-- | java/src/IceInternal/BasicStream.java | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/java/src/IceInternal/BasicStream.java b/java/src/IceInternal/BasicStream.java index 56d397471c9..75afbd7fdf7 100644 --- a/java/src/IceInternal/BasicStream.java +++ b/java/src/IceInternal/BasicStream.java @@ -24,6 +24,7 @@ public class BasicStream _currentReadEncaps = null; _currentWriteEncaps = null; + _updateStringReadTable = true; } protected void @@ -69,7 +70,7 @@ public class BasicStream private static final int MAX = 1024 * 1024; // TODO: Configurable public void - resize(int total) + resize(int total, boolean reading) { if (total > MAX) { @@ -82,21 +83,23 @@ public class BasicStream _buf = _bufferManager.reallocate(_buf, newCapacity); _capacity = _buf.capacity(); } - _buf.limit(total); - _limit = total; - } - - /* TODO - Remove? - public void - reserve(int total) - { - if (total > MAX) + // + // If this stream is used for reading, then we want to set + // the buffer's limit to the new total size. If this buffer + // is used for writing, then we must set the buffer's limit + // to the buffer's capacity. + // + if (reading) { - throw new Ice.MemoryLimitException(); + _buf.limit(total); + } + else + { + _buf.limit(_capacity); } - _buf.reserve(total); + _buf.position(total); + _limit = total; } - */ java.nio.ByteBuffer prepareRead() @@ -1002,6 +1005,18 @@ public class BasicStream throw new Ice.NoUserExceptionFactoryException(); } + public void + disableStringReadTableUpdates() + { + _updateStringReadTable = false; + } + + public void + enableStringReadTableUpdates() + { + _updateStringReadTable = true; + } + int pos() { @@ -1064,4 +1079,5 @@ public class BasicStream private java.util.LinkedList _writeEncapsStack = new java.util.LinkedList(); private ReadEncaps _currentReadEncaps; private WriteEncaps _currentWriteEncaps; + private boolean _updateStringReadTable; } |