63a7a30e6bd091f87be1de2305c6d882d68ba6a8 |
|
28-Sep-2016 |
Vijay Vasudevan <vrv@google.com> |
Add seek to FileIO via RandomAccessInputStream and BufferedInputStream, by introducing a Seek() API to those implementations. Seek is different than SkipNBytes in that you can Seek backwards, whereas on a stream, you can only move forwards. While Seek() on RandomAccessInputStream sort of makes sense, Seek() on BufferedInputStream makes a little less sense. I avoided adding Seek() to the InputStreamInterface because I didn't want all implementors of InputStreamInterface to have to implement Seek(), only those for which it made some sense. However, I did have to add a Reset() API to InputStreamInterface to allow reseting + skipping as the method of seeking backwards. Adds read(n) to FileIO. Defaults to 'read to the end of the file' as usual, and allows reading n bytes. This change is to help enable FileIO to be used as a fileobj for gzipfile, among other things. Change: 134542845
/external/tensorflow/tensorflow/core/lib/io/inputstream_interface_test.cc
|