Commit Graph

4 Commits

Author SHA1 Message Date
Aaron Boodman
cff0de3696 non-vendor changes 2016-02-08 23:15:09 -08:00
Chris Masone
51284d4384 Fix a Read() semantic issue in seekableReader
I wasn't correctly handling the case where the seekableReader had
cached a bunch of data, and then the caller sought backward and
subsequently read _less_ data than what was in the cache. I now
handle that, and have a new test to cover this case.
2016-02-05 15:53:29 -08:00
Chris Masone
ac9d801e25 Correct seekableReader.Read() semantics
I hadn't tested the case where the caller tries to Read() into
buffer that has more space than needed. ioutil.ReadAll() does this,
so it's important that this work right.
2016-02-04 15:14:15 -08:00
Chris Masone
704f4c89f6 MakeSeekable(): layer io.Seeker on an arbitrary io.Reader
By caching all reads from an io.Reader, you can make an io.ReadSeeker
out of it. MakeSeekable() actually returns something that is all of
io.Reader, io.Seeker and io.Closer, because the returned object
actually requires closing to clean up gracefully.
2016-02-04 13:44:26 -08:00