code: protected int checkRead(int length) {
      checkRead(position, length);
      int previousPosition = this.position;
      this.position = previousPosition + length;
      return offset(previousPosition);
    }
docs: Checks bounds for a read for the given length.