FileDocCategorySizeDatePackage
MappedByteBufferAdapter.javaAPI DocAndroid 1.5 API10748Wed May 06 22:41:04 BST 2009java.nio

MappedByteBufferAdapter

public final class MappedByteBufferAdapter extends MappedByteBuffer implements org.apache.harmony.nio.internal.DirectBuffer

Fields Summary
private static final int
CHAR_SIZE
private static final int
SHORT_SIZE
private static final int
INTEGER_SIZE
private static final int
LONG_SIZE
private static final int
FLOAT_SIZE
private static final int
DOUBLE_SIZE
Constructors Summary
public MappedByteBufferAdapter(ByteBuffer buffer)

    
       
        super(buffer);
    
public MappedByteBufferAdapter(org.apache.harmony.luni.platform.PlatformAddress addr, int capa, int offset, int mode)

        super(addr, capa, offset, mode);
    
Methods Summary
public voidaddressValidityCheck()

        this.wrapped.addressValidityCheck();
    
public java.nio.CharBufferasCharBuffer()

        return this.wrapped.asCharBuffer();
    
public java.nio.DoubleBufferasDoubleBuffer()

        return this.wrapped.asDoubleBuffer();
    
public java.nio.FloatBufferasFloatBuffer()

        return this.wrapped.asFloatBuffer();
    
public java.nio.IntBufferasIntBuffer()

        return this.wrapped.asIntBuffer();
    
public java.nio.LongBufferasLongBuffer()

        return this.wrapped.asLongBuffer();
    
public java.nio.ByteBufferasReadOnlyBuffer()

        MappedByteBufferAdapter buf = new MappedByteBufferAdapter(this.wrapped
                .asReadOnlyBuffer());
        buf.limit = this.limit;
        buf.position = this.position;
        buf.mark = this.mark;
        return buf;
    
public java.nio.ShortBufferasShortBuffer()

        return this.wrapped.asShortBuffer();
    
public java.nio.ByteBuffercompact()

        if (this.wrapped.isReadOnly()) {
            throw new ReadOnlyBufferException();
        }
        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        this.wrapped.compact();
        this.wrapped.clear();
        this.position = this.limit - this.position;
        this.limit = this.capacity;
        this.mark = UNSET_MARK;
        return this;
    
public java.nio.ByteBufferduplicate()

        MappedByteBufferAdapter buf = new MappedByteBufferAdapter(this.wrapped
                .duplicate());
        buf.limit = this.limit;
        buf.position = this.position;
        buf.mark = this.mark;
        return buf;
    
public voidfree()

        this.wrapped.free();
    
public byteget()

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        byte result = this.wrapped.get(); 
        this.position++;
        return result;
    
public byteget(int index)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        return this.wrapped.get(index);
    
public org.apache.harmony.luni.platform.PlatformAddressgetBaseAddress()

        return this.wrapped.getBaseAddress();
    
public intgetByteCapacity()

        return wrapped.getByteCapacity();
    
public chargetChar()

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        char result = this.wrapped.getChar();
        this.position += CHAR_SIZE;
        return result;
    
public chargetChar(int index)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        return this.wrapped.getChar(index);
    
public doublegetDouble()

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        double result = this.wrapped.getDouble();
        this.position += DOUBLE_SIZE;
        return result;
    
public doublegetDouble(int index)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        return this.wrapped.getDouble(index);
    
public org.apache.harmony.luni.platform.PlatformAddressgetEffectiveAddress()

        return ((DirectBuffer) this.wrapped).getEffectiveAddress();
    
public floatgetFloat()

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        float result = this.wrapped.getFloat();
        this.position += FLOAT_SIZE;
        return result;
    
public floatgetFloat(int index)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        return this.wrapped.getFloat(index);
    
public intgetInt()

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        int result = this.wrapped.getInt();
        this.position += INTEGER_SIZE;
        return result;
    
public intgetInt(int index)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        return this.wrapped.getInt(index);
    
public longgetLong()

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        long result = this.wrapped.getLong();
        this.position += LONG_SIZE;
        return result;
    
public longgetLong(int index)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        return this.wrapped.getLong(index);
    
public shortgetShort()

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        short result = this.wrapped.getShort();
        this.position += SHORT_SIZE;
        return result;
    
public shortgetShort(int index)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        return this.wrapped.getShort(index);
    
public booleanisAddressValid()

        return this.wrapped.isAddressValid();
    
public booleanisDirect()

        return true;
    
public booleanisReadOnly()

        return this.wrapped.isReadOnly();
    
java.nio.ByteBufferorderImpl(java.nio.ByteOrder byteOrder)

        super.orderImpl(byteOrder);
        return this.wrapped.order(byteOrder);
    
byte[]protectedArray()

        return this.wrapped.protectedArray();
    
intprotectedArrayOffset()

        return this.wrapped.protectedArrayOffset();
    
booleanprotectedHasArray()

        return this.wrapped.protectedHasArray();
    
public java.nio.ByteBufferput(byte b)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        this.wrapped.put(b);
        this.position++;
        return this;
    
public java.nio.ByteBufferput(byte[] src, int off, int len)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        this.wrapped.put(src, off, len);
        this.position += len;
        return this;
    
public java.nio.ByteBufferput(int index, byte b)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        this.wrapped.put(index, b);
        return this;
    
public java.nio.ByteBufferputChar(char value)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        this.wrapped.putChar(value);
        this.position += CHAR_SIZE;
        return this;
    
public java.nio.ByteBufferputChar(int index, char value)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        this.wrapped.putChar(index, value);
        return this;
    
public java.nio.ByteBufferputDouble(double value)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        this.wrapped.putDouble(value);
        this.position += DOUBLE_SIZE;
        return this;
    
public java.nio.ByteBufferputDouble(int index, double value)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        this.wrapped.putDouble(index, value);
        return this;
    
public java.nio.ByteBufferputFloat(float value)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        this.wrapped.putFloat(value);
        this.position += FLOAT_SIZE;
        return this;
    
public java.nio.ByteBufferputFloat(int index, float value)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        this.wrapped.putFloat(index, value);
        return this;
    
public java.nio.ByteBufferputInt(int index, int value)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        this.wrapped.putInt(index, value);
        return this;
    
public java.nio.ByteBufferputInt(int value)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        this.wrapped.putInt(value);
        this.position += INTEGER_SIZE;
        return this;
    
public java.nio.ByteBufferputLong(int index, long value)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        this.wrapped.putLong(index, value);
        return this;
    
public java.nio.ByteBufferputLong(long value)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        this.wrapped.putLong(value);
        this.position += LONG_SIZE;
        return this;
    
public java.nio.ByteBufferputShort(int index, short value)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        this.wrapped.putShort(index, value);
        return this;
    
public java.nio.ByteBufferputShort(short value)

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        this.wrapped.putShort(value);
        this.position += SHORT_SIZE;
        return this;
    
public java.nio.ByteBufferslice()

        this.wrapped.limit(this.limit);
        this.wrapped.position(this.position);
        MappedByteBufferAdapter result = new MappedByteBufferAdapter(
                this.wrapped.slice());
        this.wrapped.clear();
        return result;