It might be nice here to assert some basic things to throw better exceptions if they are wrong:

```
startIndex >= 0
endIndex > startIndex
endIndex > length of all files
```