diff --git a/Android.mk b/Android.mk
index 96b4a90..12b6fc0 100644
--- a/Android.mk
+++ b/Android.mk
@@ -127,6 +127,7 @@
     payload_consumer/bzip_extent_writer.cc \
     payload_consumer/delta_performer.cc \
     payload_consumer/download_action.cc \
+    payload_consumer/extent_reader.cc \
     payload_consumer/extent_writer.cc \
     payload_consumer/file_descriptor.cc \
     payload_consumer/file_descriptor_utils.cc \
@@ -924,6 +925,7 @@
     payload_consumer/bzip_extent_writer_unittest.cc \
     payload_consumer/delta_performer_integration_test.cc \
     payload_consumer/delta_performer_unittest.cc \
+    payload_consumer/extent_reader_unittest.cc \
     payload_consumer/extent_writer_unittest.cc \
     payload_consumer/fake_file_descriptor.cc \
     payload_consumer/file_descriptor_utils_unittest.cc \
diff --git a/payload_consumer/extent_reader.cc b/payload_consumer/extent_reader.cc
new file mode 100644
index 0000000..428ecfe
--- /dev/null
+++ b/payload_consumer/extent_reader.cc
@@ -0,0 +1,97 @@
+//
+// Copyright (C) 2017 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include "update_engine/payload_consumer/extent_reader.h"
+
+#include <sys/types.h>
+#include <unistd.h>
+
+#include "update_engine/common/utils.h"
+#include "update_engine/payload_consumer/payload_constants.h"
+
+using google::protobuf::RepeatedPtrField;
+
+namespace chromeos_update_engine {
+
+bool DirectExtentReader::Init(FileDescriptorPtr fd,
+                              const RepeatedPtrField<Extent>& extents,
+                              uint32_t block_size) {
+  fd_ = fd;
+  extents_ = extents;
+  block_size_ = block_size;
+  cur_extent_ = extents_.begin();
+
+  extents_upper_bounds_.reserve(extents_.size() + 1);
+  // We add this pad as the first element to not bother with boundary checks
+  // later.
+  extents_upper_bounds_.emplace_back(0);
+  for (const auto& extent : extents_) {
+    total_size_ += extent.num_blocks() * block_size_;
+    extents_upper_bounds_.emplace_back(total_size_);
+  }
+  return true;
+}
+
+bool DirectExtentReader::Seek(uint64_t offset) {
+  TEST_AND_RETURN_FALSE(offset <= total_size_);
+  if (offset_ == offset) {
+    return true;
+  }
+  // The first item is zero and upper_bound never returns it because it always
+  // return the item which is greater than the given value.
+  auto extent_idx = std::upper_bound(
+      extents_upper_bounds_.begin(), extents_upper_bounds_.end(), offset) -
+      extents_upper_bounds_.begin() - 1;
+  cur_extent_ = std::next(extents_.begin(), extent_idx);
+  offset_ = offset;
+  cur_extent_bytes_read_ = offset_ - extents_upper_bounds_[extent_idx];
+  return true;
+}
+
+bool DirectExtentReader::Read(void* buffer, size_t count) {
+  auto bytes = reinterpret_cast<uint8_t*>(buffer);
+  uint64_t bytes_read = 0;
+  while (bytes_read < count) {
+    if (cur_extent_ == extents_.end()) {
+      TEST_AND_RETURN_FALSE(bytes_read == count);
+    }
+    uint64_t bytes_to_read = std::min(
+        count - bytes_read,
+        cur_extent_->num_blocks() * block_size_ - cur_extent_bytes_read_);
+
+    ssize_t out_bytes_read;
+    TEST_AND_RETURN_FALSE(utils::PReadAll(
+        fd_,
+        bytes + bytes_read,
+        bytes_to_read,
+        cur_extent_->start_block() * block_size_ + cur_extent_bytes_read_,
+        &out_bytes_read));
+    TEST_AND_RETURN_FALSE(out_bytes_read ==
+                          static_cast<ssize_t>(bytes_to_read));
+
+    bytes_read += bytes_to_read;
+    cur_extent_bytes_read_ += bytes_to_read;
+    offset_ += bytes_to_read;
+    if (cur_extent_bytes_read_ == cur_extent_->num_blocks() * block_size_) {
+      // We have to advance the cur_extent_;
+      cur_extent_++;
+      cur_extent_bytes_read_ = 0;
+    }
+  }
+  return true;
+}
+
+}  // namespace chromeos_update_engine
diff --git a/payload_consumer/extent_reader.h b/payload_consumer/extent_reader.h
new file mode 100644
index 0000000..3f9e4c8
--- /dev/null
+++ b/payload_consumer/extent_reader.h
@@ -0,0 +1,82 @@
+//
+// Copyright (C) 2017 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef UPDATE_ENGINE_PAYLOAD_CONSUMER_EXTENT_READER_H_
+#define UPDATE_ENGINE_PAYLOAD_CONSUMER_EXTENT_READER_H_
+
+#include <vector>
+
+#include "update_engine/payload_consumer/file_descriptor.h"
+#include "update_engine/update_metadata.pb.h"
+
+namespace chromeos_update_engine {
+
+// ExtentReader is an abstract class with reads from a given file descriptor at
+// the extents given.
+class ExtentReader {
+ public:
+  virtual ~ExtentReader() = default;
+
+  // Initializes |ExtentReader|
+  virtual bool Init(FileDescriptorPtr fd,
+                    const google::protobuf::RepeatedPtrField<Extent>& extents,
+                    uint32_t block_size) = 0;
+
+  // Seeks to the given |offset| assuming all extents are concatenated together.
+  virtual bool Seek(uint64_t offset) = 0;
+
+  // Returns true on success.
+  virtual bool Read(void* buffer, size_t count) = 0;
+};
+
+// DirectExtentReader is probably the simplest ExtentReader implementation.
+// It reads the data directly from the extents.
+class DirectExtentReader : public ExtentReader {
+ public:
+  DirectExtentReader() = default;
+  ~DirectExtentReader() override = default;
+
+  bool Init(FileDescriptorPtr fd,
+            const google::protobuf::RepeatedPtrField<Extent>& extents,
+            uint32_t block_size) override;
+  bool Seek(uint64_t offset) override;
+  bool Read(void* bytes, size_t count) override;
+
+ private:
+  FileDescriptorPtr fd_{nullptr};
+  google::protobuf::RepeatedPtrField<Extent> extents_;
+  size_t block_size_{0};
+
+  // Current extent being read from |fd_|.
+  google::protobuf::RepeatedPtrField<Extent>::iterator cur_extent_;
+
+  // Bytes read from |cur_extent_| thus far.
+  uint64_t cur_extent_bytes_read_{0};
+
+  // Offset assuming all extents are concatenated.
+  uint64_t offset_{0};
+
+  // The accelaring upper bounds for |extents_| if we assume all extents are
+  // concatenated.
+  std::vector<uint64_t> extents_upper_bounds_;
+  uint64_t total_size_{0};
+
+  DISALLOW_COPY_AND_ASSIGN(DirectExtentReader);
+};
+
+}  // namespace chromeos_update_engine
+
+#endif  // UPDATE_ENGINE_PAYLOAD_CONSUMER_EXTENT_READER_H_
diff --git a/payload_consumer/extent_reader_unittest.cc b/payload_consumer/extent_reader_unittest.cc
new file mode 100644
index 0000000..9821775
--- /dev/null
+++ b/payload_consumer/extent_reader_unittest.cc
@@ -0,0 +1,170 @@
+//
+// Copyright (C) 2017 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include "update_engine/payload_consumer/extent_reader.h"
+
+#include <fcntl.h>
+
+#include <algorithm>
+#include <string>
+#include <vector>
+
+#include <brillo/secure_blob.h>
+#include <gtest/gtest.h>
+
+#include "update_engine/common/test_utils.h"
+#include "update_engine/common/utils.h"
+#include "update_engine/payload_consumer/file_descriptor.h"
+#include "update_engine/payload_consumer/payload_constants.h"
+#include "update_engine/payload_generator/extent_ranges.h"
+#include "update_engine/payload_generator/extent_utils.h"
+
+using chromeos_update_engine::test_utils::ExpectVectorsEq;
+using std::min;
+using std::string;
+using std::vector;
+
+namespace chromeos_update_engine {
+
+namespace {
+const size_t kBlockSize = 8;
+const size_t kRandomIterations = 1000;
+}  // namespace
+
+class ExtentReaderTest : public ::testing::Test {
+ protected:
+  void SetUp() override {
+    sample_.resize(4096 * 10);
+    srand(time(nullptr));
+    unsigned int rand_seed;
+    for (size_t i = 0; i < sample_.size(); i++) {
+      sample_[i] = rand_r(&rand_seed) % 256;
+    }
+    ASSERT_TRUE(utils::WriteFile(
+        temp_file_.path().c_str(), sample_.data(), sample_.size()));
+
+    fd_.reset(new EintrSafeFileDescriptor());
+    ASSERT_TRUE(fd_->Open(temp_file_.path().c_str(), O_RDONLY, 0600));
+  }
+  void TearDown() override { fd_->Close(); }
+
+  void ReadExtents(vector<Extent> extents, brillo::Blob* blob) {
+    blob->clear();
+    for (const auto& extent : extents) {
+      blob->insert(
+          blob->end(),
+          &sample_[extent.start_block() * kBlockSize],
+          &sample_[(extent.start_block() + extent.num_blocks()) * kBlockSize]);
+    }
+  }
+
+  FileDescriptorPtr fd_;
+  test_utils::ScopedTempFile temp_file_{"ExtentReaderTest-file.XXXXXX"};
+  brillo::Blob sample_;
+};
+
+TEST_F(ExtentReaderTest, SimpleTest) {
+  vector<Extent> extents = {ExtentForRange(1, 1)};
+  DirectExtentReader reader;
+  EXPECT_TRUE(reader.Init(fd_, {extents.begin(), extents.end()}, kBlockSize));
+  EXPECT_TRUE(reader.Seek(0));
+  brillo::Blob blob1(BlocksInExtents(extents) * kBlockSize);
+  EXPECT_TRUE(reader.Read(blob1.data(), blob1.size()));
+  brillo::Blob blob2;
+  ReadExtents(extents, &blob2);
+  ExpectVectorsEq(blob1, blob2);
+}
+
+TEST_F(ExtentReaderTest, ZeroExtentLengthTest) {
+  vector<Extent> extents = {ExtentForRange(1, 0)};
+  DirectExtentReader reader;
+  EXPECT_TRUE(reader.Init(fd_, {extents.begin(), extents.end()}, kBlockSize));
+  EXPECT_TRUE(reader.Seek(0));
+  brillo::Blob blob(1);
+  EXPECT_TRUE(reader.Read(blob.data(), 0));
+  EXPECT_FALSE(reader.Read(blob.data(), 1));
+}
+
+TEST_F(ExtentReaderTest, NoExtentTest) {
+  DirectExtentReader reader;
+  EXPECT_TRUE(reader.Init(fd_, {}, kBlockSize));
+  EXPECT_TRUE(reader.Seek(0));
+  brillo::Blob blob(1);
+  EXPECT_TRUE(reader.Read(blob.data(), 0));
+  EXPECT_FALSE(reader.Read(blob.data(), 1));
+}
+
+TEST_F(ExtentReaderTest, OverflowExtentTest) {
+  vector<Extent> extents = {ExtentForRange(1, 1)};
+  DirectExtentReader reader;
+  EXPECT_TRUE(reader.Init(fd_, {extents.begin(), extents.end()}, kBlockSize));
+  EXPECT_TRUE(reader.Seek(0));
+  brillo::Blob blob(BlocksInExtents(extents) * kBlockSize + 1);
+  EXPECT_FALSE(reader.Read(blob.data(), blob.size()));
+}
+
+TEST_F(ExtentReaderTest, SeekOverflow1Test) {
+  vector<Extent> extents = {ExtentForRange(1, 0)};
+  DirectExtentReader reader;
+  EXPECT_TRUE(reader.Init(fd_, {extents.begin(), extents.end()}, kBlockSize));
+  EXPECT_TRUE(reader.Seek(0));
+  EXPECT_FALSE(reader.Seek(1));
+}
+
+TEST_F(ExtentReaderTest, SeekOverflow2Test) {
+  DirectExtentReader reader;
+  reader.Init(fd_, {}, kBlockSize);
+  EXPECT_TRUE(reader.Seek(0));
+  EXPECT_FALSE(reader.Seek(1));
+}
+
+TEST_F(ExtentReaderTest, SeekOverflow3Test) {
+  vector<Extent> extents = {ExtentForRange(1, 1)};
+  DirectExtentReader reader;
+  EXPECT_TRUE(reader.Init(fd_, {extents.begin(), extents.end()}, kBlockSize));
+  // Seek to the end of the extents should be fine as long as nothing is read.
+  EXPECT_TRUE(reader.Seek(kBlockSize));
+  EXPECT_FALSE(reader.Seek(kBlockSize + 1));
+}
+
+TEST_F(ExtentReaderTest, RandomReadTest) {
+  vector<Extent> extents = {ExtentForRange(0, 0),
+                            ExtentForRange(1, 1),
+                            ExtentForRange(3, 0),
+                            ExtentForRange(4, 2),
+                            ExtentForRange(7, 1)};
+  DirectExtentReader reader;
+  EXPECT_TRUE(reader.Init(fd_, {extents.begin(), extents.end()}, kBlockSize));
+
+  brillo::Blob result;
+  ReadExtents(extents, &result);
+
+  brillo::Blob blob(BlocksInExtents(extents) * kBlockSize);
+  srand(time(nullptr));
+  uint32_t rand_seed;
+  for (size_t idx = 0; idx < kRandomIterations; idx++) {
+    // zero to full size available.
+    size_t start = rand_r(&rand_seed) % blob.size();
+    size_t size = rand_r(&rand_seed) % (blob.size() - start);
+    EXPECT_TRUE(reader.Seek(start));
+    EXPECT_TRUE(reader.Read(blob.data(), size));
+    for (size_t i = 0; i < size; i++) {
+      ASSERT_EQ(blob[i], result[start + i]);
+    }
+  }
+}
+
+}  // namespace chromeos_update_engine
diff --git a/update_engine.gyp b/update_engine.gyp
index 7a1ad95..41ee1e8 100644
--- a/update_engine.gyp
+++ b/update_engine.gyp
@@ -187,6 +187,7 @@
         'payload_consumer/bzip_extent_writer.cc',
         'payload_consumer/delta_performer.cc',
         'payload_consumer/download_action.cc',
+        'payload_consumer/extent_reader.cc',
         'payload_consumer/extent_writer.cc',
         'payload_consumer/file_descriptor.cc',
         'payload_consumer/file_descriptor_utils.cc',
@@ -532,6 +533,7 @@
             'payload_consumer/delta_performer_integration_test.cc',
             'payload_consumer/delta_performer_unittest.cc',
             'payload_consumer/download_action_unittest.cc',
+            'payload_consumer/extent_reader_unittest.cc',
             'payload_consumer/extent_writer_unittest.cc',
             'payload_consumer/fake_file_descriptor.cc',
             'payload_consumer/file_descriptor_utils_unittest.cc',
