summaryrefslogtreecommitdiffstats
path: root/libjava/gnu/java/nio/LongViewBufferImpl.java
diff options
context:
space:
mode:
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-13 20:11:02 +0000
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-13 20:11:02 +0000
commit23364f5f5d1d269375d0651b0b04862710ed87b7 (patch)
treed92a6527783b0b07c57de681259c0e812ace4cfd /libjava/gnu/java/nio/LongViewBufferImpl.java
parent10f6a2691da04b880014abffa51a058893b669ef (diff)
downloadppe42-gcc-23364f5f5d1d269375d0651b0b04862710ed87b7.tar.gz
ppe42-gcc-23364f5f5d1d269375d0651b0b04862710ed87b7.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66780 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu/java/nio/LongViewBufferImpl.java')
-rw-r--r--libjava/gnu/java/nio/LongViewBufferImpl.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/libjava/gnu/java/nio/LongViewBufferImpl.java b/libjava/gnu/java/nio/LongViewBufferImpl.java
index 2311fee5945..3742fca1d0b 100644
--- a/libjava/gnu/java/nio/LongViewBufferImpl.java
+++ b/libjava/gnu/java/nio/LongViewBufferImpl.java
@@ -62,8 +62,9 @@ class LongViewBufferImpl extends LongBuffer
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 LongViewBufferImpl and ByteBuffer has changed its endianess ?
this.endian = bb.order ();
@@ -71,25 +72,26 @@ class LongViewBufferImpl extends LongBuffer
public long get ()
{
- long result = bb.getLong ((position () >> 3) + offset);
+ long result = bb.getLong ((position () << 3) + offset);
position (position () + 1);
return result;
}
public long get (int index)
{
- return bb.getLong ((index >> 3) + offset);
+ return bb.getLong ((index << 3) + offset);
}
public LongBuffer put (long value)
{
- bb.putLong ((position () >> 3) + offset, value);
+ bb.putLong ((position () << 3) + offset, value);
+ position (position () + 1);
return this;
}
public LongBuffer put (int index, long value)
{
- bb.putLong ((index >> 3) + offset, value);
+ bb.putLong ((index << 3) + offset, value);
return this;
}
OpenPOWER on IntegriCloud