Interface BaseBuffer

    • Method Detail

      • incrementPosition

        BaseBuffer incrementPosition​(long increment)
        Increments the current position by the given increment. Asserts that the resource is valid and that the positional invariants are not violated, otherwise, if asserts are enabled throws an AssertionError.
        Parameters:
        increment - the given increment
        Returns:
        BaseBuffer
      • incrementAndCheckPosition

        BaseBuffer incrementAndCheckPosition​(long increment)
        Increments the current position by the given increment. Checks that the resource is valid and that the positional invariants are not violated, otherwise throws an IllegalArgumentException.
        Parameters:
        increment - the given increment
        Returns:
        BaseBuffer
      • getEnd

        long getEnd()
        Gets the end position
        Returns:
        the end position
      • getPosition

        long getPosition()
        Gets the current position
        Returns:
        the current position
      • getStart

        long getStart()
        Gets start position
        Returns:
        start position
      • getRemaining

        long getRemaining()
        The number of elements remaining between the current position and the end position
        Returns:
        (end - position)
      • hasRemaining

        boolean hasRemaining()
        Returns true if there are elements remaining between the current position and the end position
        Returns:
        (end - position) > 0
      • resetPosition

        BaseBuffer resetPosition()
        Resets the current position to the start position, This does not modify any data.
        Returns:
        BaseBuffer
      • setPosition

        BaseBuffer setPosition​(long position)
        Sets the current position.
        Parameters:
        position - the given current position.
        Returns:
        BaseBuffer
        Throws:
        BufferPositionInvariantsException - if positional invariants have been violated.
      • setStartPositionEnd

        BaseBuffer setStartPositionEnd​(long start,
                                       long position,
                                       long end)
        Sets start position, current position, and end position.
        Parameters:
        start - the start position in the buffer
        position - the current position between the start and end
        end - the end position in the buffer
        Returns:
        BaseBuffer
        Throws:
        BufferPositionInvariantsException - if positional invariants have been violated.