Home | History | Annotate | Download | only in bsdiff
      1 // Copyright 2016 The Chromium OS Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "bsdiff/sink_file.h"
      6 
      7 namespace bsdiff {
      8 
      9 SinkFile::SinkFile(const sink_func& sink)
     10     : sink_(sink) {}
     11 
     12 bool SinkFile::Read(void* buf, size_t count, size_t* bytes_read) {
     13   return false;
     14 }
     15 
     16 bool SinkFile::Write(const void* buf, size_t count, size_t* bytes_written) {
     17   *bytes_written = sink_(static_cast<const uint8_t*>(buf), count);
     18   return true;
     19 }
     20 
     21 bool SinkFile::Seek(off_t pos) {
     22   return false;
     23 }
     24 
     25 bool SinkFile::Close() {
     26   return true;
     27 }
     28 
     29 bool SinkFile::GetSize(uint64_t* size) {
     30   return false;
     31 }
     32 
     33 }  // namespace bsdiff
     34