diff options
author | Michael Koch <mkoch@gcc.gnu.org> | 2003-02-11 07:42:17 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2003-02-11 07:42:17 +0000 |
commit | d19e783c45ab5b545af64a414e5edb4e946ba9de (patch) | |
tree | df6f5ea53dd4c1bc3ba3577fe38a432e6c8f2672 /libjava/java/nio/Buffer.java | |
parent | c0da2641298d4ccc6fd491b0ed0a5117292d1c20 (diff) | |
download | gcc-d19e783c45ab5b545af64a414e5edb4e946ba9de.zip gcc-d19e783c45ab5b545af64a414e5edb4e946ba9de.tar.gz gcc-d19e783c45ab5b545af64a414e5edb4e946ba9de.tar.bz2 |
2003-02-11 Michael Koch <konqueror@gmx.de>
* java/nio/Buffer.java
(cap, lim, pos, mark): Made private
(Buffer): Added package private constructor.
* java/nio/ByteBuffer.java
(ByteBuffer): Implements Cloneable.
(offset): New member variable.
(readOnly): New member variable.
(backing_buffer): New member variable.
(allocateDirect): Throw exception and tell that direct buffers are
not supported yet, documentation added.
(allocate): Documentation added.
(wrap): Documentation added.
(ByteBuffer): New constructor.
(hasArray): New method.
(array): New method.
(arrayOffset): New method.
(get): Documentation added.
(put): Documentation added.
* java/nio/CharBuffer.java
(CharBuffer): New constructor.
(compareTo): Don't access member variables of Buffer directly.
* java/nio/DoubleBuffer.java
(allocateDirect): Throw exception and tell that direct buffers are
not supported yet.
* java/nio/FloatBuffer.java
(allocateDirect): Throw exception and tell that direct buffers are
not supported yet.
* java/nio/IntBuffer.java
(allocateDirect): Throw exception and tell that direct buffers are
not supported yet.
* java/nio/LongBuffer.java
(allocateDirect): Throw exception and tell that direct buffers are
not supported yet.
* java/nio/MappedByteBuffer.java
(MappedByteBuffer): New method.
(force): New method.
(isLoaded): New method.
(load): New method.
* java/nio/ShortBuffer.java
(allocateDirect): Throw exception and tell that direct buffers are
not supported yet.
From-SVN: r62685
Diffstat (limited to 'libjava/java/nio/Buffer.java')
-rw-r--r-- | libjava/java/nio/Buffer.java | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/libjava/java/nio/Buffer.java b/libjava/java/nio/Buffer.java index 9474fb4..7d291be 100644 --- a/libjava/java/nio/Buffer.java +++ b/libjava/java/nio/Buffer.java @@ -39,11 +39,33 @@ package java.nio; public abstract class Buffer { - int cap = 0; - int limit = 0; - int pos = 0; - int mark = -1; - + private int cap = 0; + private int limit = 0; + private int pos = 0; + private int mark = -1; + + // Creates a new Buffer. + // + // Should be package private. + // + Buffer (int capacity, int limit, int position, int mark) + { + if (capacity < 0) + throw new IllegalArgumentException (); + + cap = capacity; + limit (limit); + position (position); + + if (mark > 0) + { + if (mark > pos) + throw new IllegalArgumentException (); + + this.mark = mark; + } + } + /** * Retrieves the capacity of the buffer. */ |