aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu/java/nio/DoubleViewBufferImpl.java
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2003-05-13 20:11:02 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2003-05-13 20:11:02 +0000
commitd24273abda777ab605b1efb59bdf51db27693ca7 (patch)
treed92a6527783b0b07c57de681259c0e812ace4cfd /libjava/gnu/java/nio/DoubleViewBufferImpl.java
parent03307888f71f81829bc96f569b927a825e5ab2f4 (diff)
downloadgcc-d24273abda777ab605b1efb59bdf51db27693ca7.zip
gcc-d24273abda777ab605b1efb59bdf51db27693ca7.tar.gz
gcc-d24273abda777ab605b1efb59bdf51db27693ca7.tar.bz2
2003-05-13 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/CharViewBufferImpl.java (CharViewBufferImpl): Fixed super constructor call, initialize offset. (get): Shift bits to the right direction. (put): Likewise. * gnu/java/nio/DoubleViewBufferImpl.java (DoubleViewBufferImpl): Fixed super constructor call, initialize offset. (get): Shift bits to the right direction. (put): Likewise. * gnu/java/nio/FloatViewBufferImpl.java (FloatViewBufferImpl): Fixed super constructor call, initialize offset. (get): Shift bits to the right direction. (put): Likewise. * gnu/java/nio/IntViewBufferImpl.java (IntViewBufferImpl): Fixed super constructor call, initialize offset. (get): Shift bits to the right direction. (put): Likewise. * gnu/java/nio/LongViewBufferImpl.java (LongViewBufferImpl): Fixed super constructor call, initialize offset. (get): Shift bits to the right direction. (put): Likewise. * gnu/java/nio/ShortViewBufferImpl.java (ShortViewBufferImpl): Fixed super constructor call, initialize offset. (get): Shift bits to the right direction. (put): Likewise. From-SVN: r66780
Diffstat (limited to 'libjava/gnu/java/nio/DoubleViewBufferImpl.java')
-rw-r--r--libjava/gnu/java/nio/DoubleViewBufferImpl.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/libjava/gnu/java/nio/DoubleViewBufferImpl.java b/libjava/gnu/java/nio/DoubleViewBufferImpl.java
index d34e886..d9e1b1b 100644
--- a/libjava/gnu/java/nio/DoubleViewBufferImpl.java
+++ b/libjava/gnu/java/nio/DoubleViewBufferImpl.java
@@ -62,8 +62,9 @@ class DoubleViewBufferImpl extends DoubleBuffer
int limit, int position, int mark,
boolean readOnly)
{
- super (limit, limit, offset, position);
+ super (limit >> 3, limit >> 3, position >> 3, mark >> 3);
this.bb = bb;
+ this.offset = offset;
this.readOnly = readOnly;
// FIXME: What if this is called from DoubleViewBufferImpl and ByteBuffer has changed its endianess ?
this.endian = bb.order ();
@@ -71,25 +72,26 @@ class DoubleViewBufferImpl extends DoubleBuffer
public double get ()
{
- double result = bb.getDouble ((position () >> 3) + offset);
+ double result = bb.getDouble ((position () << 3) + offset);
position (position () + 1);
return result;
}
public double get (int index)
{
- return bb.getDouble ((index >> 3) + offset);
+ return bb.getDouble ((index << 3) + offset);
}
public DoubleBuffer put (double value)
{
- bb.putDouble ((position () >> 3) + offset, value);
+ bb.putDouble ((position () << 3) + offset, value);
+ position (position () + 1);
return this;
}
public DoubleBuffer put (int index, double value)
{
- bb.putDouble ((index >> 3) + offset, value);
+ bb.putDouble ((index << 3) + offset, value);
return this;
}