blob: 217787af3fcc24392aea597c58c56697d924a4f5 [file] [log] [blame]
Sen Jiang716d5692016-05-09 16:43:34 -07001// 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
Alex Deymodcd423b2017-09-13 20:54:24 +02005#include "bsdiff/sink_file.h"
Sen Jiang716d5692016-05-09 16:43:34 -07006
7namespace bsdiff {
8
9SinkFile::SinkFile(const sink_func& sink)
10 : sink_(sink) {}
11
12bool SinkFile::Read(void* buf, size_t count, size_t* bytes_read) {
13 return false;
14}
15
16bool 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
21bool SinkFile::Seek(off_t pos) {
22 return false;
23}
24
25bool SinkFile::Close() {
26 return true;
27}
28
29bool SinkFile::GetSize(uint64_t* size) {
30 return false;
31}
32
33} // namespace bsdiff