OSDN Git Service

libjava/ChangeLog:
[pf3gnuchains/gcc-fork.git] / libjava / classpath / java / nio / IntViewBufferImpl.java
index cd8307f..9af5d58 100644 (file)
@@ -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);
   }
 
   /**