diff options
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/nio/CharViewBufferImpl.java | 11 | ||||
-rw-r--r-- | libjava/java/nio/DoubleViewBufferImpl.java | 11 | ||||
-rw-r--r-- | libjava/java/nio/FloatViewBufferImpl.java | 11 | ||||
-rw-r--r-- | libjava/java/nio/IntViewBufferImpl.java | 11 | ||||
-rw-r--r-- | libjava/java/nio/LongViewBufferImpl.java | 11 | ||||
-rw-r--r-- | libjava/java/nio/ShortViewBufferImpl.java | 11 |
6 files changed, 60 insertions, 6 deletions
diff --git a/libjava/java/nio/CharViewBufferImpl.java b/libjava/java/nio/CharViewBufferImpl.java index b1cc9071724..ee99cfbe069 100644 --- a/libjava/java/nio/CharViewBufferImpl.java +++ b/libjava/java/nio/CharViewBufferImpl.java @@ -46,11 +46,20 @@ class CharViewBufferImpl extends CharBuffer private boolean readOnly; private ByteOrder endian; + CharViewBufferImpl (ByteBuffer bb, int capacity) + { + super (capacity, capacity, 0, -1); + this.bb = bb; + this.offset = bb.position(); + this.readOnly = bb.isReadOnly(); + this.endian = bb.order(); + } + public CharViewBufferImpl (ByteBuffer bb, int offset, int capacity, int limit, int position, int mark, boolean readOnly, ByteOrder endian) { - super (limit >> 1, limit >> 1, position >> 1, mark >> 1); + super (capacity, limit, position, mark); this.bb = bb; this.offset = offset; this.readOnly = readOnly; diff --git a/libjava/java/nio/DoubleViewBufferImpl.java b/libjava/java/nio/DoubleViewBufferImpl.java index ac27746ba0d..7df2f509b58 100644 --- a/libjava/java/nio/DoubleViewBufferImpl.java +++ b/libjava/java/nio/DoubleViewBufferImpl.java @@ -46,11 +46,20 @@ class DoubleViewBufferImpl extends DoubleBuffer private boolean readOnly; private ByteOrder endian; + DoubleViewBufferImpl (ByteBuffer bb, int capacity) + { + super (capacity, capacity, 0, -1); + this.bb = bb; + this.offset = bb.position(); + this.readOnly = bb.isReadOnly(); + this.endian = bb.order(); + } + public DoubleViewBufferImpl (ByteBuffer bb, int offset, int capacity, int limit, int position, int mark, boolean readOnly, ByteOrder endian) { - super (limit >> 3, limit >> 3, position >> 3, mark >> 3); + super (capacity, limit, position, mark); this.bb = bb; this.offset = offset; this.readOnly = readOnly; diff --git a/libjava/java/nio/FloatViewBufferImpl.java b/libjava/java/nio/FloatViewBufferImpl.java index 88bc92553ab..c4caf9bf322 100644 --- a/libjava/java/nio/FloatViewBufferImpl.java +++ b/libjava/java/nio/FloatViewBufferImpl.java @@ -46,11 +46,20 @@ class FloatViewBufferImpl extends FloatBuffer private boolean readOnly; private ByteOrder endian; + FloatViewBufferImpl (ByteBuffer bb, int capacity) + { + super (capacity, capacity, 0, -1); + this.bb = bb; + this.offset = bb.position(); + this.readOnly = bb.isReadOnly(); + this.endian = bb.order(); + } + public FloatViewBufferImpl (ByteBuffer bb, int offset, int capacity, int limit, int position, int mark, boolean readOnly, ByteOrder endian) { - super (limit >> 2, limit >> 2, position >> 2, mark >> 2); + super (capacity, limit, position, mark); this.bb = bb; this.offset = offset; this.readOnly = readOnly; diff --git a/libjava/java/nio/IntViewBufferImpl.java b/libjava/java/nio/IntViewBufferImpl.java index 8e384c9017d..3c8e8e61ca2 100644 --- a/libjava/java/nio/IntViewBufferImpl.java +++ b/libjava/java/nio/IntViewBufferImpl.java @@ -46,11 +46,20 @@ class IntViewBufferImpl extends IntBuffer private boolean readOnly; private ByteOrder endian; + IntViewBufferImpl (ByteBuffer bb, int capacity) + { + super (capacity, capacity, 0, -1); + this.bb = bb; + this.offset = bb.position(); + this.readOnly = bb.isReadOnly(); + this.endian = bb.order(); + } + public IntViewBufferImpl (ByteBuffer bb, int offset, int capacity, int limit, int position, int mark, boolean readOnly, ByteOrder endian) { - super (limit >> 2, limit >> 2, position >> 2, mark >> 2); + super (capacity, limit, position, mark); this.bb = bb; this.offset = offset; this.readOnly = readOnly; diff --git a/libjava/java/nio/LongViewBufferImpl.java b/libjava/java/nio/LongViewBufferImpl.java index a405ec871a5..9765de9cd0f 100644 --- a/libjava/java/nio/LongViewBufferImpl.java +++ b/libjava/java/nio/LongViewBufferImpl.java @@ -46,11 +46,20 @@ class LongViewBufferImpl extends LongBuffer private boolean readOnly; private ByteOrder endian; + LongViewBufferImpl (ByteBuffer bb, int capacity) + { + super (capacity, capacity, 0, -1); + this.bb = bb; + this.offset = bb.position(); + this.readOnly = bb.isReadOnly(); + this.endian = bb.order(); + } + public LongViewBufferImpl (ByteBuffer bb, int offset, int capacity, int limit, int position, int mark, boolean readOnly, ByteOrder endian) { - super (limit >> 3, limit >> 3, position >> 3, mark >> 3); + super (capacity, limit, position, mark); this.bb = bb; this.offset = offset; this.readOnly = readOnly; diff --git a/libjava/java/nio/ShortViewBufferImpl.java b/libjava/java/nio/ShortViewBufferImpl.java index b217f1cb553..04d778578b0 100644 --- a/libjava/java/nio/ShortViewBufferImpl.java +++ b/libjava/java/nio/ShortViewBufferImpl.java @@ -45,12 +45,21 @@ class ShortViewBufferImpl extends ShortBuffer private ByteBuffer bb; private boolean readOnly; private ByteOrder endian; + + ShortViewBufferImpl (ByteBuffer bb, int capacity) + { + super (capacity, capacity, 0, -1); + this.bb = bb; + this.offset = bb.position(); + this.readOnly = bb.isReadOnly(); + this.endian = bb.order(); + } public ShortViewBufferImpl (ByteBuffer bb, int offset, int capacity, int limit, int position, int mark, boolean readOnly, ByteOrder endian) { - super (limit >> 1, limit >> 1, position >> 1, mark >> 1); + super (capacity, limit, position, mark); this.bb = bb; this.offset = offset; this.readOnly = readOnly; |