Index: java/nio/Buffer.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/nio/Buffer.java,v retrieving revision 1.13 diff -u -r1.13 Buffer.java --- java/nio/Buffer.java 22 Oct 2004 17:15:56 -0000 1.13 +++ java/nio/Buffer.java 7 Jan 2005 18:47:01 -0000 @@ -38,12 +38,18 @@ package java.nio; +import gnu.classpath.RawData; + +/** + * @since 1.4 + */ public abstract class Buffer { int cap = 0; int limit = 0; int pos = 0; int mark = -1; + RawData address; /** * Creates a new Buffer. Index: java/nio/CharViewBufferImpl.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/nio/CharViewBufferImpl.java,v retrieving revision 1.5 diff -u -r1.5 CharViewBufferImpl.java --- java/nio/CharViewBufferImpl.java 30 Dec 2004 10:20:11 -0000 1.5 +++ java/nio/CharViewBufferImpl.java 7 Jan 2005 18:47:01 -0000 @@ -53,6 +53,8 @@ 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, @@ -64,6 +66,8 @@ this.offset = offset; this.readOnly = readOnly; this.endian = endian; + if (bb.isDirect()) + this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset); } /** Index: java/nio/DirectByteBufferImpl.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/nio/DirectByteBufferImpl.java,v retrieving revision 1.17 diff -u -r1.17 DirectByteBufferImpl.java --- java/nio/DirectByteBufferImpl.java 30 Dec 2004 10:20:11 -0000 1.17 +++ java/nio/DirectByteBufferImpl.java 7 Jan 2005 18:47:01 -0000 @@ -56,8 +56,6 @@ * memory and should free it. */ private final Object owner; - - final RawData address; static final class ReadOnly extends DirectByteBufferImpl { Index: java/nio/DoubleViewBufferImpl.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/nio/DoubleViewBufferImpl.java,v retrieving revision 1.6 diff -u -r1.6 DoubleViewBufferImpl.java --- java/nio/DoubleViewBufferImpl.java 30 Dec 2004 10:20:11 -0000 1.6 +++ java/nio/DoubleViewBufferImpl.java 7 Jan 2005 18:47:01 -0000 @@ -53,6 +53,8 @@ this.offset = bb.position(); this.readOnly = bb.isReadOnly(); this.endian = bb.order(); + if (bb.isDirect()) + this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset); } public DoubleViewBufferImpl (ByteBuffer bb, int offset, int capacity, @@ -64,6 +66,8 @@ this.offset = offset; this.readOnly = readOnly; this.endian = endian; + if (bb.isDirect()) + this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset); } /** Index: java/nio/FloatViewBufferImpl.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/nio/FloatViewBufferImpl.java,v retrieving revision 1.6 diff -u -r1.6 FloatViewBufferImpl.java --- java/nio/FloatViewBufferImpl.java 30 Dec 2004 10:20:11 -0000 1.6 +++ java/nio/FloatViewBufferImpl.java 7 Jan 2005 18:47:01 -0000 @@ -53,6 +53,8 @@ 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, @@ -64,6 +66,8 @@ this.offset = offset; this.readOnly = readOnly; this.endian = endian; + if (bb.isDirect()) + this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset); } /** Index: java/nio/IntViewBufferImpl.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/nio/IntViewBufferImpl.java,v retrieving revision 1.6 diff -u -r1.6 IntViewBufferImpl.java --- java/nio/IntViewBufferImpl.java 30 Dec 2004 10:20:11 -0000 1.6 +++ java/nio/IntViewBufferImpl.java 7 Jan 2005 18:47:01 -0000 @@ -53,6 +53,8 @@ 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, @@ -64,6 +66,8 @@ this.offset = offset; this.readOnly = readOnly; this.endian = endian; + if (bb.isDirect()) + this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset); } /** Index: java/nio/LongViewBufferImpl.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/nio/LongViewBufferImpl.java,v retrieving revision 1.6 diff -u -r1.6 LongViewBufferImpl.java --- java/nio/LongViewBufferImpl.java 30 Dec 2004 10:20:11 -0000 1.6 +++ java/nio/LongViewBufferImpl.java 7 Jan 2005 18:47:01 -0000 @@ -53,6 +53,8 @@ this.offset = bb.position(); this.readOnly = bb.isReadOnly(); this.endian = bb.order(); + if (bb.isDirect()) + this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset); } public LongViewBufferImpl (ByteBuffer bb, int offset, int capacity, @@ -64,6 +66,8 @@ this.offset = offset; this.readOnly = readOnly; this.endian = endian; + if (bb.isDirect()) + this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset); } /** Index: java/nio/MappedByteBufferImpl.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/nio/MappedByteBufferImpl.java,v retrieving revision 1.15 diff -u -r1.15 MappedByteBufferImpl.java --- java/nio/MappedByteBufferImpl.java 30 Dec 2004 10:20:11 -0000 1.15 +++ java/nio/MappedByteBufferImpl.java 7 Jan 2005 18:47:01 -0000 @@ -45,7 +45,6 @@ final class MappedByteBufferImpl extends MappedByteBuffer { boolean readOnly; - RawData address; /** Posix uses this for the pointer returned by mmap; * Win32 uses it for the pointer returned by MapViewOfFile. */ Index: java/nio/ShortViewBufferImpl.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/nio/ShortViewBufferImpl.java,v retrieving revision 1.6 diff -u -r1.6 ShortViewBufferImpl.java --- java/nio/ShortViewBufferImpl.java 30 Dec 2004 10:20:11 -0000 1.6 +++ java/nio/ShortViewBufferImpl.java 7 Jan 2005 18:47:01 -0000 @@ -53,6 +53,8 @@ this.offset = bb.position(); this.readOnly = bb.isReadOnly(); this.endian = bb.order(); + if (bb.isDirect()) + this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset); } public ShortViewBufferImpl (ByteBuffer bb, int offset, int capacity, @@ -64,6 +66,8 @@ this.offset = offset; this.readOnly = readOnly; this.endian = endian; + if (bb.isDirect()) + this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset); } /**