/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
#if[rw]
#else[rw]
* A read-only Heap$Type$Buffer. This class extends the corresponding
* ReadOnlyBufferException} and overriding the view-buffer methods to return an
* instance of this class rather than of the superclass.
#end[rw]
*/
{
// For speed these fields are actually declared in X-Buffer;
// these declarations are here as documentation
/*
#if[rw]
protected final $type$[] hb;
protected final int offset;
#end[rw]
*/
#if[rw]
/*
hb = new $type$[cap];
offset = 0;
*/
#else[rw]
this.isReadOnly = true;
}
#if[rw]
/*
hb = buf;
offset = 0;
*/
#else[rw]
this.isReadOnly = true;
}
int off)
{
#if[rw]
/*
hb = buf;
offset = off;
*/
#else[rw]
this.isReadOnly = true;
}
-1,
0,
this.remaining(),
this.remaining(),
}
this.markValue(),
this.position(),
this.limit(),
this.capacity(),
offset);
}
#if[rw]
this.markValue(),
this.position(),
this.limit(),
this.capacity(),
offset);
#else[rw]
return duplicate();
}
#if[rw]
protected int ix(int i) {
return i + offset;
}
}
}
throw new BufferUnderflowException();
return this;
}
public boolean isDirect() {
return false;
}
public boolean isReadOnly() {
return {#if[rw]?false:true};
}
#if[rw]
return this;
#else[rw]
throw new ReadOnlyBufferException();
}
#if[rw]
return this;
#else[rw]
throw new ReadOnlyBufferException();
}
#if[rw]
throw new BufferOverflowException();
return this;
#else[rw]
throw new ReadOnlyBufferException();
}
#if[rw]
if (src == this)
throw new IllegalArgumentException();
if (n > remaining())
throw new BufferOverflowException();
if (n > remaining())
throw new BufferOverflowException();
} else {
}
return this;
#else[rw]
throw new ReadOnlyBufferException();
}
#if[rw]
discardMark();
return this;
#else[rw]
throw new ReadOnlyBufferException();
}
#if[byte]
byte _get(int i) { // package-private
return hb[i];
}
void _put(int i, byte b) { // package-private
#if[rw]
hb[i] = b;
#else[rw]
throw new ReadOnlyBufferException();
}
// char
#if[rw]
public char getChar() {
}
public char getChar(int i) {
}
#if[rw]
return this;
#else[rw]
throw new ReadOnlyBufferException();
}
#if[rw]
return this;
#else[rw]
throw new ReadOnlyBufferException();
}
public CharBuffer asCharBuffer() {
return (bigEndian
-1,
0,
size,
size,
off))
-1,
0,
size,
size,
off)));
}
// short
#if[rw]
public short getShort() {
}
public short getShort(int i) {
}
#if[rw]
return this;
#else[rw]
throw new ReadOnlyBufferException();
}
#if[rw]
return this;
#else[rw]
throw new ReadOnlyBufferException();
}
public ShortBuffer asShortBuffer() {
return (bigEndian
-1,
0,
size,
size,
off))
-1,
0,
size,
size,
off)));
}
// int
#if[rw]
public int getInt() {
}
public int getInt(int i) {
}
#if[rw]
return this;
#else[rw]
throw new ReadOnlyBufferException();
}
#if[rw]
return this;
#else[rw]
throw new ReadOnlyBufferException();
}
public IntBuffer asIntBuffer() {
return (bigEndian
-1,
0,
size,
size,
off))
-1,
0,
size,
size,
off)));
}
// long
#if[rw]
public long getLong() {
}
public long getLong(int i) {
}
#if[rw]
return this;
#else[rw]
throw new ReadOnlyBufferException();
}
#if[rw]
return this;
#else[rw]
throw new ReadOnlyBufferException();
}
public LongBuffer asLongBuffer() {
return (bigEndian
-1,
0,
size,
size,
off))
-1,
0,
size,
size,
off)));
}
// float
#if[rw]
public float getFloat() {
}
public float getFloat(int i) {
}
#if[rw]
return this;
#else[rw]
throw new ReadOnlyBufferException();
}
#if[rw]
return this;
#else[rw]
throw new ReadOnlyBufferException();
}
public FloatBuffer asFloatBuffer() {
return (bigEndian
-1,
0,
size,
size,
off))
-1,
0,
size,
size,
off)));
}
// double
#if[rw]
public double getDouble() {
}
public double getDouble(int i) {
}
#if[rw]
return this;
#else[rw]
throw new ReadOnlyBufferException();
}
#if[rw]
return this;
#else[rw]
throw new ReadOnlyBufferException();
}
public DoubleBuffer asDoubleBuffer() {
return (bigEndian
-1,
0,
size,
size,
off))
-1,
0,
size,
size,
off)));
}
#end[byte]
#if[char]
try {
} catch (StringIndexOutOfBoundsException x) {
throw new IndexOutOfBoundsException();
}
}
// --- Methods to support CharSequence ---
if ((start < 0)
throw new IndexOutOfBoundsException();
-1,
capacity(),
offset);
}
#end[char]
#if[!byte]
return ByteOrder.nativeOrder();
}
#end[!byte]
}