• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
SinkFile(const sink_func & sink)9 SinkFile::SinkFile(const sink_func& sink)
10     : sink_(sink) {}
11 
Read(void * buf,size_t count,size_t * bytes_read)12 bool SinkFile::Read(void* buf, size_t count, size_t* bytes_read) {
13   return false;
14 }
15 
Write(const void * buf,size_t count,size_t * bytes_written)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 
Seek(off_t pos)21 bool SinkFile::Seek(off_t pos) {
22   return false;
23 }
24 
Close()25 bool SinkFile::Close() {
26   return true;
27 }
28 
GetSize(uint64_t * size)29 bool SinkFile::GetSize(uint64_t* size) {
30   return false;
31 }
32 
33 }  // namespace bsdiff
34