diff options
Diffstat (limited to 'libjava/classpath/java/nio/CharViewBufferImpl.java')
-rw-r--r-- | libjava/classpath/java/nio/CharViewBufferImpl.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libjava/classpath/java/nio/CharViewBufferImpl.java b/libjava/classpath/java/nio/CharViewBufferImpl.java index 33bbac8b000..98a27a6e601 100644 --- a/libjava/classpath/java/nio/CharViewBufferImpl.java +++ b/libjava/classpath/java/nio/CharViewBufferImpl.java @@ -41,33 +41,33 @@ package java.nio; class CharViewBufferImpl extends CharBuffer { /** Position in bb (i.e. a byte offset) where this buffer starts. */ - private int offset; - private ByteBuffer bb; - private boolean readOnly; - private ByteOrder endian; + private final int offset; + private final ByteBuffer bb; + private final boolean readOnly; + private final ByteOrder endian; CharViewBufferImpl (ByteBuffer bb, int capacity) { - super (capacity, capacity, 0, -1); + super (capacity, capacity, 0, -1, bb.isDirect() ? + VMDirectByteBuffer.adjustAddress(bb.address, bb.position()) : null, + null, 0); this.bb = bb; this.offset = bb.position(); this.readOnly = bb.isReadOnly(); this.endian = bb.order(); - if (bb.isDirect()) - this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset); } public CharViewBufferImpl (ByteBuffer bb, int offset, int capacity, int limit, int position, int mark, boolean readOnly, ByteOrder endian) { - super (capacity, limit, position, mark); + super (capacity, limit, position, mark, bb.isDirect() ? + VMDirectByteBuffer.adjustAddress(bb.address, offset) : null, + null, 0); this.bb = bb; this.offset = offset; this.readOnly = readOnly; this.endian = endian; - if (bb.isDirect()) - this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset); } /** |