summaryrefslogtreecommitdiff
path: root/java/nio
diff options
context:
space:
mode:
authorCasey Marshall <csm@gnu.org>2006-08-06 20:55:08 +0000
committerCasey Marshall <csm@gnu.org>2006-08-06 20:55:08 +0000
commit28608c659d5008732362bbc41f120879a11b42de (patch)
treeefc1c9836b6cb1087a2f793b485918d44b01426c /java/nio
parent97780de3b0a92a67ccd1be4020d49497f9cf051d (diff)
downloadclasspath-28608c659d5008732362bbc41f120879a11b42de.tar.gz
2006-08-06 C. Scott Marshall <csm@gnu.org>
Fixes PR 28608. * java/nio/DirectByteBufferImpl.java (duplicate): only reset if the mark has been set. * native/jni/java-nio/java_nio_VMDirectByteBuffer.c (Java_java_nio_VMDirectByteBuffer_allocate): zero out the allocated data.
Diffstat (limited to 'java/nio')
-rw-r--r--java/nio/DirectByteBufferImpl.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/java/nio/DirectByteBufferImpl.java b/java/nio/DirectByteBufferImpl.java
index 53bb668aa..8c907f597 100644
--- a/java/nio/DirectByteBufferImpl.java
+++ b/java/nio/DirectByteBufferImpl.java
@@ -232,7 +232,8 @@ abstract class DirectByteBufferImpl extends ByteBuffer
private ByteBuffer duplicate(boolean readOnly)
{
int pos = position();
- reset();
+ if (this.mark != -1)
+ reset();
int mark = position();
position(pos);
DirectByteBufferImpl result;