Package libcore.io

Class BufferIterator

    • Constructor Summary

      Constructors 
      Constructor Description
      BufferIterator()  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      abstract byte readByte()
      Returns the byte at the current position, and advances the current position one byte.
      abstract void readByteArray​(byte[] dst, int dstOffset, int byteCount)
      Copies byteCount bytes from the current position into dst, starting at dstOffset, and advances the current position byteCount bytes.
      abstract int readInt()
      Returns the 32-bit int at the current position, and advances the current position four bytes.
      abstract void readIntArray​(int[] dst, int dstOffset, int intCount)
      Copies intCount 32-bit ints from the current position into dst, starting at dstOffset, and advances the current position 4 * intCount bytes.
      abstract short readShort()
      Returns the 16-bit short at the current position, and advances the current position two bytes.
      abstract void seek​(int offset)
      Seeks to the absolute position offset, measured in bytes from the start.
      abstract void skip​(int byteCount)
      Skips forwards or backwards byteCount bytes from the current position.
    • Constructor Detail

      • BufferIterator

        public BufferIterator()
    • Method Detail

      • seek

        public abstract void seek​(int offset)
        Seeks to the absolute position offset, measured in bytes from the start.
      • skip

        public abstract void skip​(int byteCount)
        Skips forwards or backwards byteCount bytes from the current position.
      • readByteArray

        public abstract void readByteArray​(byte[] dst,
                                           int dstOffset,
                                           int byteCount)
        Copies byteCount bytes from the current position into dst, starting at dstOffset, and advances the current position byteCount bytes.
      • readByte

        public abstract byte readByte()
        Returns the byte at the current position, and advances the current position one byte.
      • readInt

        public abstract int readInt()
        Returns the 32-bit int at the current position, and advances the current position four bytes.
      • readIntArray

        public abstract void readIntArray​(int[] dst,
                                          int dstOffset,
                                          int intCount)
        Copies intCount 32-bit ints from the current position into dst, starting at dstOffset, and advances the current position 4 * intCount bytes.
      • readShort

        public abstract short readShort()
        Returns the 16-bit short at the current position, and advances the current position two bytes.