2 * Copyright 2009-2011, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
7 #include <package/hpkg/DataReader.h>
13 namespace BPackageKit
{
18 BFDDataReader::BFDDataReader(int fd
)
26 BFDDataReader::SetFD(int fd
)
33 BFDDataReader::ReadData(off_t offset
, void* buffer
, size_t size
)
35 ssize_t bytesRead
= pread(fFD
, buffer
, size
, offset
);
38 return (size_t)bytesRead
== size
? B_OK
: B_ERROR
;
44 } // namespace BPackageKit