diff options
author | Per Bothner <per@bothner.com> | 2004-02-08 13:02:53 -0800 |
---|---|---|
committer | Per Bothner <bothner@gcc.gnu.org> | 2004-02-08 13:02:53 -0800 |
commit | 40c23042f4594368c96e1af7dc65b72590d584b0 (patch) | |
tree | a1e145e7726c0c5b674ef91a6ecd841daaa826ef /libjava/java/nio/natDirectByteBufferImpl.cc | |
parent | b46b8fb40cf29c5f724d87f6022c6c8242e50bf2 (diff) | |
download | gcc-40c23042f4594368c96e1af7dc65b72590d584b0.zip gcc-40c23042f4594368c96e1af7dc65b72590d584b0.tar.gz gcc-40c23042f4594368c96e1af7dc65b72590d584b0.tar.bz2 |
ByteBuffer.java (shiftDown): New helper method.
* java/nio/ByteBuffer.java (shiftDown): New helper method.
* java/nio/natDirectByteBufferImpl.cc (shiftDown): New implementation.
* java/nio/ByteBufferImpl.java (compact): Use new shiftDown method.
* sava/nio/ByteBufferHelper.java: Remove redundant 'final' specifiers.
Pass ByteOrder parameter to most methods, since the underlying
ByteBuffer's order isn't always what we should use.
* java/nio/ByteBufferImpl.java: Pass byte-order various places.
* java/nio/DirectByteBufferImpl.java: Likewise.
Use ByteBufferHelper methods.
* java/nio/MappedByteBufferImpl.java: Likewise.
(compact): Use shiftDown.
* java/nio/CharViewBufferImpl.java (<init>): Pass byte-order.
(get, put): Use ByteBufferHelper.
(compact): Use new shiftDown method.
(duplicate(boolean)): New helper method.
(duplicate, asReadOnlyBuffer): Use it.
(order): Return endian field.
* java/nio/DoubleViewBufferImpl.java: Likewise.
* java/nio/FloatViewBufferImpl.java: Likewise.
* java/nio/IntViewBufferImpl.java: Likewise.
* java/nio/LongViewBufferImpl.java: Likewise.
* java/nio/ShortViewBufferImpl.java: Likewise.
* java/nio/CharViewBufferImpl.java (subsequence): Redundant test.
* java/nio/DirectByteBufferImpl.java (shiftDown): New native method.
(compact): Re-implement using shiftDown.
From-SVN: r77501
Diffstat (limited to 'libjava/java/nio/natDirectByteBufferImpl.cc')
-rw-r--r-- | libjava/java/nio/natDirectByteBufferImpl.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libjava/java/nio/natDirectByteBufferImpl.cc b/libjava/java/nio/natDirectByteBufferImpl.cc index 2ceea17..7ff06ff 100644 --- a/libjava/java/nio/natDirectByteBufferImpl.cc +++ b/libjava/java/nio/natDirectByteBufferImpl.cc @@ -43,3 +43,12 @@ java::nio::DirectByteBufferImpl::putImpl (jint index, jbyte value) jbyte* pointer = reinterpret_cast<jbyte*> (address) + offset + index; *pointer = value; } + +void +java::nio::DirectByteBufferImpl::shiftDown +(jint dst_offset, jint src_offset, jint count) +{ + jbyte* dst = reinterpret_cast<jbyte*> (address) + offset + dst_offset; + jbyte* src = reinterpret_cast<jbyte*> (address) + offset + src_offset; + ::memmove(dst, src, count); +} |