diff options
Diffstat (limited to 'libjava/classpath/java/nio/ByteBufferImpl.java')
| -rw-r--r-- | libjava/classpath/java/nio/ByteBufferImpl.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/libjava/classpath/java/nio/ByteBufferImpl.java b/libjava/classpath/java/nio/ByteBufferImpl.java index aa51a65bdd5..6a1ac4681da 100644 --- a/libjava/classpath/java/nio/ByteBufferImpl.java +++ b/libjava/classpath/java/nio/ByteBufferImpl.java @@ -43,13 +43,12 @@ package java.nio; */ final class ByteBufferImpl extends ByteBuffer { - private boolean readOnly; + private final boolean readOnly; - ByteBufferImpl (byte[] buffer, int offset, int capacity, int limit, int position, int mark, boolean readOnly) + ByteBufferImpl (byte[] 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; } @@ -90,17 +89,20 @@ final class ByteBufferImpl extends ByteBuffer public ByteBuffer slice () { - return new ByteBufferImpl (backing_buffer, array_offset + position (), remaining (), remaining (), 0, -1, isReadOnly ()); + return new ByteBufferImpl (backing_buffer, array_offset + position (), + remaining (), remaining (), 0, -1, isReadOnly ()); } public ByteBuffer duplicate () { - return new ByteBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, isReadOnly ()); + return new ByteBufferImpl (backing_buffer, array_offset, capacity (), + limit (), position (), mark, isReadOnly ()); } public ByteBuffer asReadOnlyBuffer () { - return new ByteBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, true); + return new ByteBufferImpl (backing_buffer, array_offset, capacity (), + limit (), position (), mark, true); } void shiftDown (int dst_offset, int src_offset, int count) |
