*/
final class LongBufferImpl extends LongBuffer
{
- private boolean readOnly;
+ private final boolean readOnly;
LongBufferImpl (int capacity)
{
this (new long [capacity], 0, capacity, capacity, 0, -1, false);
}
- LongBufferImpl (long[] buffer, int offset, int capacity, int limit, int position, int mark, boolean readOnly)
+ LongBufferImpl (long[] 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;
}
public LongBuffer slice ()
{
- return new LongBufferImpl (backing_buffer, array_offset + position (), remaining (), remaining (), 0, -1, isReadOnly ());
+ return new LongBufferImpl (backing_buffer, array_offset + position (),
+ remaining (), remaining (), 0, -1, isReadOnly ());
}
public LongBuffer duplicate ()
{
- return new LongBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, isReadOnly ());
+ return new LongBufferImpl (backing_buffer, array_offset, capacity (), limit (),
+ position (), mark, isReadOnly ());
}
public LongBuffer asReadOnlyBuffer ()
{
- return new LongBufferImpl (backing_buffer, array_offset, capacity (), limit (), position (), mark, true);
+ return new LongBufferImpl (backing_buffer, array_offset, capacity (), limit (),
+ position (), mark, true);
}
public LongBuffer compact ()