FileDocCategorySizeDatePackage
HeapByteBufferR.javaAPI DocJava SE 5 API6697Fri Aug 26 16:48:02 BST 2005java.nio

HeapByteBufferR

public class HeapByteBufferR extends HeapByteBuffer
A read-only HeapByteBuffer. This class extends the corresponding read/write class, overriding the mutation methods to throw a {@link ReadOnlyBufferException} and overriding the view-buffer methods to return an instance of this class rather than of the superclass.

Fields Summary
Constructors Summary
HeapByteBufferR(int cap, int lim)

		// package-private







	super(cap, lim);
	this.isReadOnly = true;

    
HeapByteBufferR(byte[] buf, int off, int len)

 // package-private







	super(buf, off, len);
	this.isReadOnly = true;

    
protected HeapByteBufferR(byte[] buf, int mark, int pos, int lim, int cap, int off)








	super(buf, mark, pos, lim, cap, off);
	this.isReadOnly = true;

    
Methods Summary
byte_get(int i)

				// package-private
	return hb[i];
    
void_put(int i, byte b)

			// package-private



	throw new ReadOnlyBufferException();

    
public java.nio.CharBufferasCharBuffer()

	int size = this.remaining() >> 1;
	int off = offset + position();
	return (bigEndian
		? (CharBuffer)(new ByteBufferAsCharBufferRB(this,
							       -1,
							       0,
							       size,
							       size,
							       off))
		: (CharBuffer)(new ByteBufferAsCharBufferRL(this,
							       -1,
							       0,
							       size,
							       size,
							       off)));
    
public java.nio.DoubleBufferasDoubleBuffer()

	int size = this.remaining() >> 3;
	int off = offset + position();
	return (bigEndian
		? (DoubleBuffer)(new ByteBufferAsDoubleBufferRB(this,
								   -1,
								   0,
								   size,
								   size,
								   off))
		: (DoubleBuffer)(new ByteBufferAsDoubleBufferRL(this,
								   -1,
								   0,
								   size,
								   size,
								   off)));
    
public java.nio.FloatBufferasFloatBuffer()

	int size = this.remaining() >> 2;
	int off = offset + position();
	return (bigEndian
		? (FloatBuffer)(new ByteBufferAsFloatBufferRB(this,
								 -1,
								 0,
								 size,
								 size,
								 off))
		: (FloatBuffer)(new ByteBufferAsFloatBufferRL(this,
								 -1,
								 0,
								 size,
								 size,
								 off)));
    
public java.nio.IntBufferasIntBuffer()

	int size = this.remaining() >> 2;
	int off = offset + position();
	return (bigEndian
		? (IntBuffer)(new ByteBufferAsIntBufferRB(this,
							     -1,
							     0,
							     size,
							     size,
							     off))
		: (IntBuffer)(new ByteBufferAsIntBufferRL(this,
							     -1,
							     0,
							     size,
							     size,
							     off)));
    
public java.nio.LongBufferasLongBuffer()

	int size = this.remaining() >> 3;
	int off = offset + position();
	return (bigEndian
		? (LongBuffer)(new ByteBufferAsLongBufferRB(this,
							       -1,
							       0,
							       size,
							       size,
							       off))
		: (LongBuffer)(new ByteBufferAsLongBufferRL(this,
							       -1,
							       0,
							       size,
							       size,
							       off)));
    
public java.nio.ByteBufferasReadOnlyBuffer()









	return duplicate();

    
public java.nio.ShortBufferasShortBuffer()

	int size = this.remaining() >> 1;
	int off = offset + position();
	return (bigEndian
		? (ShortBuffer)(new ByteBufferAsShortBufferRB(this,
								 -1,
								 0,
								 size,
								 size,
								 off))
		: (ShortBuffer)(new ByteBufferAsShortBufferRL(this,
								 -1,
								 0,
								 size,
								 size,
								 off)));
    
public java.nio.ByteBuffercompact()







	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferduplicate()

	return new HeapByteBufferR(hb,
					this.markValue(),
					this.position(),
					this.limit(),
					this.capacity(),
					offset);
    
public booleanisReadOnly()

	return true;
    
public java.nio.ByteBufferput(byte[] src, int offset, int length)









	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferput(java.nio.ByteBuffer src)
























	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferput(byte x)





	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferput(int i, byte x)





	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferputChar(char x)





	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferputChar(int i, char x)





	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferputDouble(double x)





	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferputDouble(int i, double x)





	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferputFloat(float x)





	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferputFloat(int i, float x)





	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferputInt(int x)





	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferputInt(int i, int x)





	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferputLong(long x)





	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferputLong(int i, long x)





	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferputShort(short x)





	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferputShort(int i, short x)





	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferslice()

	return new HeapByteBufferR(hb,
					-1,
					0,
					this.remaining(),
					this.remaining(),
					this.position() + offset);