summaryrefslogtreecommitdiff
path: root/java/src/IceInternal/Buffer.java
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2001-11-21 21:07:27 +0000
committerMark Spruiell <mes@zeroc.com>2001-11-21 21:07:27 +0000
commit7331b062836d26ab63323e2f58c27a6220592ea5 (patch)
treeebafc1c41f253a6dcdac910127980ec505aed3c3 /java/src/IceInternal/Buffer.java
parentUpdated to properly send in the AdapterReady notification and the ProcessId (diff)
downloadice-7331b062836d26ab63323e2f58c27a6220592ea5.tar.bz2
ice-7331b062836d26ab63323e2f58c27a6220592ea5.tar.xz
ice-7331b062836d26ab63323e2f58c27a6220592ea5.zip
Initial check-in
Diffstat (limited to 'java/src/IceInternal/Buffer.java')
-rw-r--r--java/src/IceInternal/Buffer.java51
1 files changed, 51 insertions, 0 deletions
diff --git a/java/src/IceInternal/Buffer.java b/java/src/IceInternal/Buffer.java
new file mode 100644
index 00000000000..de08e52f393
--- /dev/null
+++ b/java/src/IceInternal/Buffer.java
@@ -0,0 +1,51 @@
+// **********************************************************************
+//
+// Copyright (c) 2001
+// MutableRealms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+package IceInternal;
+
+public class Buffer
+{
+ public
+ Buffer()
+ {
+ data = new byte[1500];
+ pos = 0;
+ len = 0;
+ }
+
+ public void
+ resize(int n)
+ {
+ if (n > data.length)
+ {
+ int sz = data.length << 1;
+ byte[] arr = new byte[n < sz ? sz : n];
+ System.arraycopy(data, 0, arr, 0, len);
+ data = arr;
+ }
+ len = n;
+ }
+
+ public void
+ reserve(int n)
+ {
+ if (n > data.length)
+ {
+ int sz = data.length << 1;
+ byte[] arr = new byte[n < sz ? sz : n];
+ System.arraycopy(data, 0, arr, 0, len);
+ data = arr;
+ }
+ }
+
+ public byte[] data;
+ public int pos;
+ public int len;
+}