FileDocCategorySizeDatePackage
BridgeBufferIterator.javaAPI DocAndroid 5.1 API2058Thu Mar 12 22:22:44 GMT 2015com.android.layoutlib.bridge.libcore.io

BridgeBufferIterator

public class BridgeBufferIterator extends libcore.io.BufferIterator
Provides an implementation of {@link BufferIterator} over a {@link ByteBuffer}.

Fields Summary
private final long
mSize
private final ByteBuffer
mByteBuffer
Constructors Summary
public BridgeBufferIterator(long size, ByteBuffer buffer)

        mSize = size;
        mByteBuffer = buffer;
    
Methods Summary
public bytereadByte()

        return mByteBuffer.get();
    
public voidreadByteArray(byte[] dst, int dstOffset, int byteCount)

        assert dst.length >= dstOffset + byteCount;
        mByteBuffer.get(dst, dstOffset, byteCount);
    
public intreadInt()

        return mByteBuffer.getInt();
    
public voidreadIntArray(int[] dst, int dstOffset, int intCount)

        while (--intCount >= 0) {
            dst[dstOffset++] = mByteBuffer.getInt();
        }
    
public shortreadShort()

        return mByteBuffer.getShort();
    
public voidseek(int offset)

        assert offset <= mSize;
        mByteBuffer.position(offset);
    
public voidskip(int byteCount)

        int newPosition = mByteBuffer.position() + byteCount;
        assert newPosition <= mSize;
        mByteBuffer.position(newPosition);