FileDocCategorySizeDatePackage
DirectByteBufferR.javaAPI DocJava SE 5 API10671Fri Aug 26 16:48:50 BST 2005java.nio

DirectByteBufferR

public class DirectByteBufferR extends DirectByteBuffer implements DirectBuffer

Fields Summary
Constructors Summary
DirectByteBufferR(int cap)

			// package-private




















	super(cap);

    
protected DirectByteBufferR(int cap, long addr, Runnable unmapper)







	super(cap, addr, unmapper);

    
DirectByteBufferR(DirectBuffer db, int mark, int pos, int lim, int cap, int off)









	super(db, mark, pos, lim, cap, off);

    
Methods Summary
byte_get(int i)

				// package-private
	return unsafe.getByte(address + i);
    
void_put(int i, byte b)

			// package-private



	throw new ReadOnlyBufferException();

    
public java.nio.CharBufferasCharBuffer()

	int off = this.position();
	int lim = this.limit();
	assert (off <= lim);
	int rem = (off <= lim ? lim - off : 0);

	int size = rem >> 1;
 	if (!unaligned && ((address + off) % (1 << 1) != 0)) {
	    return (bigEndian
		    ? (CharBuffer)(new ByteBufferAsCharBufferRB(this,
								       -1,
								       0,
								       size,
								       size,
								       off))
		    : (CharBuffer)(new ByteBufferAsCharBufferRL(this,
								       -1,
								       0,
								       size,
								       size,
								       off)));
	} else {
	    return (nativeByteOrder
		    ? (CharBuffer)(new DirectCharBufferRU(this,
								 -1,
								 0,
								 size,
								 size,
								 off))
		    : (CharBuffer)(new DirectCharBufferRS(this,
								 -1,
								 0,
								 size,
								 size,
								 off)));
	}
    
public java.nio.DoubleBufferasDoubleBuffer()

	int off = this.position();
	int lim = this.limit();
	assert (off <= lim);
	int rem = (off <= lim ? lim - off : 0);

	int size = rem >> 3;
 	if (!unaligned && ((address + off) % (1 << 3) != 0)) {
	    return (bigEndian
		    ? (DoubleBuffer)(new ByteBufferAsDoubleBufferRB(this,
								       -1,
								       0,
								       size,
								       size,
								       off))
		    : (DoubleBuffer)(new ByteBufferAsDoubleBufferRL(this,
								       -1,
								       0,
								       size,
								       size,
								       off)));
	} else {
	    return (nativeByteOrder
		    ? (DoubleBuffer)(new DirectDoubleBufferRU(this,
								 -1,
								 0,
								 size,
								 size,
								 off))
		    : (DoubleBuffer)(new DirectDoubleBufferRS(this,
								 -1,
								 0,
								 size,
								 size,
								 off)));
	}
    
public java.nio.FloatBufferasFloatBuffer()

	int off = this.position();
	int lim = this.limit();
	assert (off <= lim);
	int rem = (off <= lim ? lim - off : 0);

	int size = rem >> 2;
 	if (!unaligned && ((address + off) % (1 << 2) != 0)) {
	    return (bigEndian
		    ? (FloatBuffer)(new ByteBufferAsFloatBufferRB(this,
								       -1,
								       0,
								       size,
								       size,
								       off))
		    : (FloatBuffer)(new ByteBufferAsFloatBufferRL(this,
								       -1,
								       0,
								       size,
								       size,
								       off)));
	} else {
	    return (nativeByteOrder
		    ? (FloatBuffer)(new DirectFloatBufferRU(this,
								 -1,
								 0,
								 size,
								 size,
								 off))
		    : (FloatBuffer)(new DirectFloatBufferRS(this,
								 -1,
								 0,
								 size,
								 size,
								 off)));
	}
    
public java.nio.IntBufferasIntBuffer()

	int off = this.position();
	int lim = this.limit();
	assert (off <= lim);
	int rem = (off <= lim ? lim - off : 0);

	int size = rem >> 2;
 	if (!unaligned && ((address + off) % (1 << 2) != 0)) {
	    return (bigEndian
		    ? (IntBuffer)(new ByteBufferAsIntBufferRB(this,
								       -1,
								       0,
								       size,
								       size,
								       off))
		    : (IntBuffer)(new ByteBufferAsIntBufferRL(this,
								       -1,
								       0,
								       size,
								       size,
								       off)));
	} else {
	    return (nativeByteOrder
		    ? (IntBuffer)(new DirectIntBufferRU(this,
								 -1,
								 0,
								 size,
								 size,
								 off))
		    : (IntBuffer)(new DirectIntBufferRS(this,
								 -1,
								 0,
								 size,
								 size,
								 off)));
	}
    
public java.nio.LongBufferasLongBuffer()

	int off = this.position();
	int lim = this.limit();
	assert (off <= lim);
	int rem = (off <= lim ? lim - off : 0);

	int size = rem >> 3;
 	if (!unaligned && ((address + off) % (1 << 3) != 0)) {
	    return (bigEndian
		    ? (LongBuffer)(new ByteBufferAsLongBufferRB(this,
								       -1,
								       0,
								       size,
								       size,
								       off))
		    : (LongBuffer)(new ByteBufferAsLongBufferRL(this,
								       -1,
								       0,
								       size,
								       size,
								       off)));
	} else {
	    return (nativeByteOrder
		    ? (LongBuffer)(new DirectLongBufferRU(this,
								 -1,
								 0,
								 size,
								 size,
								 off))
		    : (LongBuffer)(new DirectLongBufferRS(this,
								 -1,
								 0,
								 size,
								 size,
								 off)));
	}
    
public java.nio.ByteBufferasReadOnlyBuffer()









	return duplicate();

    
public java.nio.ShortBufferasShortBuffer()

	int off = this.position();
	int lim = this.limit();
	assert (off <= lim);
	int rem = (off <= lim ? lim - off : 0);

	int size = rem >> 1;
 	if (!unaligned && ((address + off) % (1 << 1) != 0)) {
	    return (bigEndian
		    ? (ShortBuffer)(new ByteBufferAsShortBufferRB(this,
								       -1,
								       0,
								       size,
								       size,
								       off))
		    : (ShortBuffer)(new ByteBufferAsShortBufferRL(this,
								       -1,
								       0,
								       size,
								       size,
								       off)));
	} else {
	    return (nativeByteOrder
		    ? (ShortBuffer)(new DirectShortBufferRU(this,
								 -1,
								 0,
								 size,
								 size,
								 off))
		    : (ShortBuffer)(new DirectShortBufferRS(this,
								 -1,
								 0,
								 size,
								 size,
								 off)));
	}
    
public java.nio.ByteBuffercompact()












	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferduplicate()

	return new DirectByteBufferR(this,
					      this.markValue(),
					      this.position(),
					      this.limit(),
					      this.capacity(),
					      0);
    
public booleanisDirect()

	return true;
    
public booleanisReadOnly()

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























	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.ByteBufferput(java.nio.ByteBuffer src)





































	throw new ReadOnlyBufferException();

    
private java.nio.ByteBufferputChar(long a, char x)










	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferputChar(char x)





	throw new ReadOnlyBufferException();

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





	throw new ReadOnlyBufferException();

    
private java.nio.ByteBufferputDouble(long a, double x)










	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferputDouble(double x)





	throw new ReadOnlyBufferException();

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





	throw new ReadOnlyBufferException();

    
private java.nio.ByteBufferputFloat(long a, float x)










	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferputFloat(float x)





	throw new ReadOnlyBufferException();

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





	throw new ReadOnlyBufferException();

    
private java.nio.ByteBufferputInt(long a, int x)










	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferputInt(int x)





	throw new ReadOnlyBufferException();

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





	throw new ReadOnlyBufferException();

    
private java.nio.ByteBufferputLong(long a, long x)










	throw new ReadOnlyBufferException();

    
public java.nio.ByteBufferputLong(long x)





	throw new ReadOnlyBufferException();

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





	throw new ReadOnlyBufferException();

    
private java.nio.ByteBufferputShort(long a, short 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()

	int pos = this.position();
	int lim = this.limit();
	assert (pos <= lim);
	int rem = (pos <= lim ? lim - pos : 0);
	int off = (pos << 0);
        assert (off >= 0);
	return new DirectByteBufferR(this, -1, 0, rem, rem, off);