FileDocCategorySizeDatePackage
ShortArrayCodeInput.javaAPI DocAndroid 5.1 API2011Thu Mar 12 22:18:30 GMT 2015com.android.dx.io.instructions

ShortArrayCodeInput

public final class ShortArrayCodeInput extends BaseCodeCursor implements CodeInput
Implementation of {@code CodeInput} that reads from a {@code short[]}.

Fields Summary
private final short[]
array
source array to read from
Constructors Summary
public ShortArrayCodeInput(short[] array)
Constructs an instance.

        if (array == null) {
            throw new NullPointerException("array == null");
        }

        this.array = array;
    
Methods Summary
public booleanhasMore()

inheritDoc

        return cursor() < array.length;
    
public intread()

inheritDoc

        try {
            int value = array[cursor()];
            advance(1);
            return value & 0xffff;
        } catch (ArrayIndexOutOfBoundsException ex) {
            throw new EOFException();
        }
    
public intreadInt()

inheritDoc

        int short0 = read();
        int short1 = read();

        return short0 | (short1 << 16);
    
public longreadLong()

inheritDoc

        long short0 = read();
        long short1 = read();
        long short2 = read();
        long short3 = read();

        return short0 | (short1 << 16) | (short2 << 32) | (short3 << 48);