diff options
Diffstat (limited to 'libjava/classpath/java/nio/FloatViewBufferImpl.java')
-rw-r--r-- | libjava/classpath/java/nio/FloatViewBufferImpl.java | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/libjava/classpath/java/nio/FloatViewBufferImpl.java b/libjava/classpath/java/nio/FloatViewBufferImpl.java index 8bb342d103d..9f10d824fe0 100644 --- a/libjava/classpath/java/nio/FloatViewBufferImpl.java +++ b/libjava/classpath/java/nio/FloatViewBufferImpl.java @@ -41,33 +41,31 @@ package java.nio; final class FloatViewBufferImpl extends FloatBuffer { /** 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; FloatViewBufferImpl (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 FloatViewBufferImpl (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); } /** |