summaryrefslogtreecommitdiff
path: root/libjava/java/nio/CharViewBufferImpl.java
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-16 19:54:49 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-16 19:54:49 +0000
commite88045708e1899ddaec5c5597476cbd3efd39266 (patch)
tree27a478c335b8222aff1ffd69e6d9692486bc95ec /libjava/java/nio/CharViewBufferImpl.java
parentd451e97420229396bf35700c60922d60f2711d14 (diff)
downloadgcc-e88045708e1899ddaec5c5597476cbd3efd39266.tar.gz
* java/nio/CharViewBufferImpl.java: New convenience constructor.
Fix buggy call to super constructor. * java/nio/DoubleViewBufferImpl.java: Likewise. * java/nio/FloatViewBufferImpl.java: Likewise. * java/nio/IntViewBufferImpl.java: Likewise. * java/nio/LongViewBufferImpl.java: Likewise. * java/nio/ShortViewBufferImpl.java: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77917 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/nio/CharViewBufferImpl.java')
-rw-r--r--libjava/java/nio/CharViewBufferImpl.java11
1 files changed, 10 insertions, 1 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;