public DirectBufferVector validate ( ) { final int capacity = buffer . capacity ( ) ; if ( offset < 0 || offset >= capacity ) { throw new IllegalArgumentException ( "offset=" + offset + " capacity=" + capacity ) ; } if ( length < 0 || length > ( capacity - offset ) ) { throw new IllegalArgumentException ( "offset=" + offset + " capacity=" + capacity + " length=" + length ) ; } return this ; }
Ensure the vector is valid for the buffer .