aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/nio/CharViewBufferImpl.java
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2005-01-07 11:32:07 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2005-01-07 11:32:07 +0000
commitd2ba8a75ef0a2bbc078df1a101235a05b6e70787 (patch)
treebe94893c552db65c2384cd29222e07c02378c21c /libjava/java/nio/CharViewBufferImpl.java
parent4600cc14275bb31771b3a5ee914125af1796064b (diff)
downloadgcc-d2ba8a75ef0a2bbc078df1a101235a05b6e70787.zip
gcc-d2ba8a75ef0a2bbc078df1a101235a05b6e70787.tar.gz
gcc-d2ba8a75ef0a2bbc078df1a101235a05b6e70787.tar.bz2
re PR libgcj/18115 (JNI nio buffer functions only work with byte buffers)
2005-01-07 Michael Koch <konqueror@gmx.de> PR libgcj/18115 * java/nio/Buffer.java (address): New field. * java/nio/DirectByteBufferImpl.java (address): Removed. * java/nio/MappedByteBufferImpl.java (address): Likewise. * java/nio/CharViewBufferImpl.java (CharViewBufferImpl): Explicitly initialize Buffer.address if needed. * java/nio/DoubleViewBufferImpl.java (DoubleViewBufferImpl): Likewise. * java/nio/FloatViewBufferImpl.java (FloatViewBufferImpl): Likewise. * java/nio/IntViewBufferImpl.java (IntViewBufferImpl): Likewise. * java/nio/LongViewBufferImpl.java (LongViewBufferImpl): Likewise. * java/nio/ShortViewBufferImpl.java (ShortViewBufferImpl): Likewise. * jni.cc (_Jv_JNI_GetDirectBufferAddress): Don't assume buffer is a DirectByteBufferImpl object. (_Jv_JNI_GetDirectBufferCapacity): Likewise. * testsuite/libjava.jni/directbuffer.c, testsuite/libjava.jni/directbuffer.java, testsuite/libjava.jni/directbuffer.out, testsuite/libjava.jni/bytebuffer.c, testsuite/libjava.jni/bytebuffer.java, testsuite/libjava.jni/bytebuffer.out: New files. From-SVN: r93046
Diffstat (limited to 'libjava/java/nio/CharViewBufferImpl.java')
-rw-r--r--libjava/java/nio/CharViewBufferImpl.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/libjava/java/nio/CharViewBufferImpl.java b/libjava/java/nio/CharViewBufferImpl.java
index 3c02108..2701983 100644
--- a/libjava/java/nio/CharViewBufferImpl.java
+++ b/libjava/java/nio/CharViewBufferImpl.java
@@ -53,6 +53,8 @@ class CharViewBufferImpl extends CharBuffer
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 @@ class CharViewBufferImpl extends CharBuffer
this.offset = offset;
this.readOnly = readOnly;
this.endian = endian;
+ if (bb.isDirect())
+ this.address = VMDirectByteBuffer.adjustAddress(bb.address, offset);
}
/**