aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/lib
diff options
context:
space:
mode:
authorGravatar Ruoxin Sang <rxsang@google.com>2018-06-08 17:14:48 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-06-08 17:17:12 -0700
commit245651f9dce1e787ceb55a3155b26ab45552fc4f (patch)
tree2be57c7b4b6864788216f90eeef218d3c4cb8c6f /tensorflow/core/lib
parentf8f70a84c12ab432094f762082e82f5decfe3414 (diff)
Remove logic in RandomAccessInputStream to check for out of range read, as it has been done in RandomAccessFile::Read().
PiperOrigin-RevId: 199873976
Diffstat (limited to 'tensorflow/core/lib')
-rw-r--r--tensorflow/core/lib/io/random_inputstream.cc10
1 files changed, 1 insertions, 9 deletions
diff --git a/tensorflow/core/lib/io/random_inputstream.cc b/tensorflow/core/lib/io/random_inputstream.cc
index 09336e79cd..e85367df9c 100644
--- a/tensorflow/core/lib/io/random_inputstream.cc
+++ b/tensorflow/core/lib/io/random_inputstream.cc
@@ -45,16 +45,8 @@ Status RandomAccessInputStream::ReadNBytes(int64 bytes_to_read,
result->resize(data.size());
if (s.ok() || errors::IsOutOfRange(s)) {
pos_ += data.size();
- } else {
- return s;
}
- // If the amount of data we read is less than what we wanted, we return an
- // out of range error. We need to catch this explicitly since file_->Read()
- // would not do so if at least 1 byte is read (b/30839063).
- if (data.size() < bytes_to_read) {
- return errors::OutOfRange("reached end of file");
- }
- return Status::OK();
+ return s;
}
// To limit memory usage, the default implementation of SkipNBytes() only reads