Package libcore.io

Class NioBufferIterator

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte readByte()
      Returns the byte at the current position, and advances the current position one byte.
      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.
      int readInt()
      Returns the 32-bit int at the current position, and advances the current position four bytes.
      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.
      short readShort()
      Returns the 16-bit short at the current position, and advances the current position two bytes.
      void seek​(int offset)
      Seeks to the absolute position offset, measured in bytes from the start.
      void skip​(int byteCount)
      Skips forwards or backwards byteCount bytes from the current position.
    • Method Detail

      • seek

        public void seek​(int offset)
        Description copied from class: BufferIterator
        Seeks to the absolute position offset, measured in bytes from the start.
        Specified by:
        seek in class BufferIterator
      • skip

        public void skip​(int byteCount)
        Description copied from class: BufferIterator
        Skips forwards or backwards byteCount bytes from the current position.
        Specified by:
        skip in class BufferIterator
      • readByteArray

        public void readByteArray​(byte[] dst,
                                  int dstOffset,
                                  int byteCount)
        Description copied from class: BufferIterator
        Copies byteCount bytes from the current position into dst, starting at dstOffset, and advances the current position byteCount bytes.
        Specified by:
        readByteArray in class BufferIterator
      • readByte

        public byte readByte()
        Description copied from class: BufferIterator
        Returns the byte at the current position, and advances the current position one byte.
        Specified by:
        readByte in class BufferIterator
      • readInt

        public int readInt()
        Description copied from class: BufferIterator
        Returns the 32-bit int at the current position, and advances the current position four bytes.
        Specified by:
        readInt in class BufferIterator
      • readIntArray

        public void readIntArray​(int[] dst,
                                 int dstOffset,
                                 int intCount)
        Description copied from class: BufferIterator
        Copies intCount 32-bit ints from the current position into dst, starting at dstOffset, and advances the current position 4 * intCount bytes.
        Specified by:
        readIntArray in class BufferIterator
      • readShort

        public short readShort()
        Description copied from class: BufferIterator
        Returns the 16-bit short at the current position, and advances the current position two bytes.
        Specified by:
        readShort in class BufferIterator