apache/spark — pull request #2321 by rxin (2014-09-08 19:17:54+00:00)
Title: [SPARK-3442] LengthBoundedInputStream

This commit creates LengthBoundedInputStream, an InputStream decorator that limits the number of bytes returned from an underlying InputStream. This will be used to create an InputStream directly from a segment of a file (FileInputStream always reads till EOF).