protected void checkOffset ( long offset ) { if ( offset ( offset ) < this . offset ) { throw new IndexOutOfBoundsException ( ) ; } else if ( limit == - 1 ) { if ( offset > maxCapacity ) throw new IndexOutOfBoundsException ( ) ; } else { if ( offset > limit ) throw new IndexOutOfBoundsException ( ) ; } }
Checks that the offset is within the bounds of the buffer .