X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=libjava%2Fclasspath%2Fjava%2Fnio%2FIntViewBufferImpl.java;h=9af5d58a4dc9ac3dbf0f2229294c32d5beac26e6;hp=cd8307f3ebd99073fc5977e230cefc9ba6554f07;hb=2bc043354c4edb1f5aad751285060fb722a63ea1;hpb=be9f921eb27de7f5f22e4755df15340ab8042a09 diff --git a/libjava/classpath/java/nio/IntViewBufferImpl.java b/libjava/classpath/java/nio/IntViewBufferImpl.java index cd8307f3ebd..9af5d58a4dc 100644 --- a/libjava/classpath/java/nio/IntViewBufferImpl.java +++ b/libjava/classpath/java/nio/IntViewBufferImpl.java @@ -41,33 +41,31 @@ package java.nio; final class IntViewBufferImpl extends IntBuffer { /** 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; IntViewBufferImpl (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 IntViewBufferImpl (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); } /**