From 11dde1bb18eaf7a6981bc5e7e46cc7d945d55182 Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Wed, 24 Nov 2004 10:44:18 +0000 Subject: NIOServerSocket.java: Added email to @author tag. 2004-11-24 Michael Koch * gnu/java/nio/NIOServerSocket.java: Added email to @author tag. * java/nio/DirectByteBufferImpl.java: Moved native methods to java.nio.VMDirectByteBuffer class. * java/nio/MappedByteBufferImpl.java: Use native methods from java.nio.VMDirectByteBuffer class. * java/nio/VMDirectByteBuffer.java: New file, * java/nio/natDirectByteBufferImpl.cc: Moved all methods into java.nio.VMDirectByteBuffer class. * java/nio/channels/spi/AbstractSelectableChannel.java (register): Only re-use valid keys. * Makefile.am: Added java/nio/VMDirectByteBuffer.java. * Makefile.in: Regenerated. From-SVN: r91146 --- libjava/java/nio/MappedByteBufferImpl.java | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'libjava/java/nio/MappedByteBufferImpl.java') diff --git a/libjava/java/nio/MappedByteBufferImpl.java b/libjava/java/nio/MappedByteBufferImpl.java index 8f41322..c5cf355 100644 --- a/libjava/java/nio/MappedByteBufferImpl.java +++ b/libjava/java/nio/MappedByteBufferImpl.java @@ -72,8 +72,8 @@ final class MappedByteBufferImpl extends MappedByteBuffer checkForUnderflow(); int pos = position(); - byte result = DirectByteBufferImpl.getImpl(address, pos); - position (pos + 1); + byte result = VMDirectByteBuffer.get(address, pos); + position(pos + 1); return result; } @@ -83,7 +83,7 @@ final class MappedByteBufferImpl extends MappedByteBuffer checkForOverflow(); int pos = position(); - DirectByteBufferImpl.putImpl(address, pos, value); + VMDirectByteBuffer.put(address, pos, value); position(pos + 1); return this; } @@ -92,7 +92,7 @@ final class MappedByteBufferImpl extends MappedByteBuffer { checkIndex(index); - return DirectByteBufferImpl.getImpl(address, index); + return VMDirectByteBuffer.get(address, index); } public ByteBuffer get(byte[] dst, int offset, int length) @@ -101,7 +101,7 @@ final class MappedByteBufferImpl extends MappedByteBuffer checkForUnderflow(length); int index = position(); - DirectByteBufferImpl.getImpl(address, index, dst, offset, length); + VMDirectByteBuffer.get(address, index, dst, offset, length); position(index+length); return this; @@ -112,7 +112,7 @@ final class MappedByteBufferImpl extends MappedByteBuffer checkIfReadOnly(); checkIndex(index); - DirectByteBufferImpl.putImpl(address, index, value); + VMDirectByteBuffer.put(address, index, value); return this; } @@ -123,7 +123,7 @@ final class MappedByteBufferImpl extends MappedByteBuffer { int count = remaining(); // Call shiftDown method optimized for direct buffers. - DirectByteBufferImpl.shiftDown(address, 0, pos, count); + VMDirectByteBuffer.shiftDown(address, 0, pos, count); position(count); limit(capacity()); } @@ -138,10 +138,9 @@ final class MappedByteBufferImpl extends MappedByteBuffer public ByteBuffer slice() { int rem = remaining(); - return new DirectByteBufferImpl (this, - DirectByteBufferImpl - .adjustAddress(address, position()), - rem, rem, 0, isReadOnly ()); + return new DirectByteBufferImpl + (this, VMDirectByteBuffer.adjustAddress(address, position()), + rem, rem, 0, isReadOnly()); } private ByteBuffer duplicate(boolean readOnly) -- cgit v1.1