After LUCENE-4371, we still have a non-optimal implementation of IndexInput#slice() in RAMDirectory. We should fix that to use the cloning approach like other directories do
Make all Directory implementations correctly fail with IllegalArgumentException if slices are out of bounds
Improve BufferedIndexInput.SlicedIndexInput to directly delegate
Patch, including new test.
The default impl is now only used by Solr anymore. We should fix this, too and remove the BufferedIndexInput.wrap() one completely.
This improvement is especially important for slices of NRTCachingDirectory, because it uses RAMDirectory internally, too!
Added ineffectivity warning to BufferedIndexInput#wrap() and cleaned up sliceDescription to be consistent.
Improve IllegalArgumentExceptions, be more strict on out-of-bounds slice.
I will commit this tomorrow and backport to 4.10.
Looks good, thanks Uwe!