summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/java/nio/DoubleBufferImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/java/nio/DoubleBufferImpl.java')
-rw-r--r--libjava/classpath/java/nio/DoubleBufferImpl.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/libjava/classpath/java/nio/DoubleBufferImpl.java b/libjava/classpath/java/nio/DoubleBufferImpl.java
index 98e8e974fff..bc292df646d 100644
--- a/libjava/classpath/java/nio/DoubleBufferImpl.java
+++ b/libjava/classpath/java/nio/DoubleBufferImpl.java
@@ -43,18 +43,17 @@ package java.nio;
*/
final class DoubleBufferImpl extends DoubleBuffer
{
- private boolean readOnly;
+ private final boolean readOnly;
DoubleBufferImpl (int capacity)
{
this (new double [capacity], 0, capacity, capacity, 0, -1, false);
}
- DoubleBufferImpl (double[] buffer, int offset, int capacity, int limit, int position, int mark, boolean readOnly)
+ DoubleBufferImpl (double[] buffer, int offset, int capacity, int limit,
+ int position, int mark, boolean readOnly)
{
- super (capacity, limit, position, mark);
- this.backing_buffer = buffer;
- this.array_offset = offset;
+ super (capacity, limit, position, mark, null, buffer, offset);
this.readOnly = readOnly;
}
@@ -65,17 +64,20 @@ final class DoubleBufferImpl extends DoubleBuffer
public DoubleBuffer slice ()
{
- return new DoubleBufferImpl (backing_buffer, array_offset + position (), remaining (), remaining (), 0, -1, isReadOnly ());
+ return new DoubleBufferImpl (backing_buffer, array_offset + position (),
+ remaining (), remaining (), 0, -1, isReadOnly ());
}
public DoubleBuffer duplicate ()
{
- return new DoubleBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, isReadOnly ());
+ return new DoubleBufferImpl (backing_buffer, array_offset, capacity (),
+ limit (), position (), mark, isReadOnly ());
}
public DoubleBuffer asReadOnlyBuffer ()
{
- return new DoubleBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, true);
+ return new DoubleBufferImpl (backing_buffer, array_offset, capacity (),
+ limit (), position (), mark, true);
}
public DoubleBuffer compact ()
OpenPOWER on IntegriCloud