summaryrefslogtreecommitdiff
path: root/libjava/java/nio/ByteBuffer.java
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-08 21:02:53 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-08 21:02:53 +0000
commit197915730a262fc3b228c34eebc4ee9896d3584f (patch)
treea1e145e7726c0c5b674ef91a6ecd841daaa826ef /libjava/java/nio/ByteBuffer.java
parent15056364602d1dc8040451e1cd09783f418c7c0a (diff)
downloadgcc-197915730a262fc3b228c34eebc4ee9896d3584f.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77501 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/nio/ByteBuffer.java')
-rw-r--r--libjava/java/nio/ByteBuffer.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/libjava/java/nio/ByteBuffer.java b/libjava/java/nio/ByteBuffer.java
index 3be797750d0..9ca20618c45 100644
--- a/libjava/java/nio/ByteBuffer.java
+++ b/libjava/java/nio/ByteBuffer.java
@@ -1,5 +1,5 @@
/* ByteBuffer.java --
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -382,8 +382,14 @@ public abstract class ByteBuffer extends Buffer
*/
public abstract ByteBuffer compact ();
+ void shiftDown (int dst_offset, int src_offset, int count)
+ {
+ for (int i = 0; i < count; i++)
+ put(dst_offset + i, get(src_offset + i));
+ }
+
/**
- * Tells wether or not this buffer is direct.
+ * Tells whether or not this buffer is direct.
*/
public abstract boolean isDirect ();