#include "puffin/src/puffin_stream.h"
#include <algorithm>
#include <cstring>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "puffin/src/bit_reader.h"
#include "puffin/src/bit_writer.h"
#include "puffin/src/include/puffin/common.h"
#include "puffin/src/include/puffin/huffer.h"
#include "puffin/src/include/puffin/puffer.h"
#include "puffin/src/include/puffin/stream.h"
#include "puffin/src/logging.h"
#include "puffin/src/puff_reader.h"
#include "puffin/src/puff_writer.h"
shared_ptr;
unique_ptr;
vector;
namespace puffin {
namespace {
bool CheckArgsIntegrity(uint64_t puff_size,
const vector<BitExtent>& deflates,
const vector<ByteExtent>& puffs) { … }
}
UniqueStreamPtr PuffinStream::CreateForPuff(UniqueStreamPtr stream,
shared_ptr<Puffer> puffer,
uint64_t puff_size,
const vector<BitExtent>& deflates,
const vector<ByteExtent>& puffs,
size_t max_cache_size) { … }
UniqueStreamPtr PuffinStream::CreateForHuff(UniqueStreamPtr stream,
shared_ptr<Huffer> huffer,
uint64_t puff_size,
const vector<BitExtent>& deflates,
const vector<ByteExtent>& puffs) { … }
PuffinStream::PuffinStream(UniqueStreamPtr stream,
shared_ptr<Puffer> puffer,
shared_ptr<Huffer> huffer,
uint64_t puff_size,
const vector<BitExtent>& deflates,
const vector<ByteExtent>& puffs,
size_t max_cache_size)
: … { … }
bool PuffinStream::GetSize(uint64_t* size) { … }
bool PuffinStream::GetOffset(uint64_t* offset) { … }
bool PuffinStream::Seek(uint64_t offset) { … }
bool PuffinStream::Close() { … }
bool PuffinStream::Read(void* buffer, size_t count) { … }
bool PuffinStream::Write(const void* buffer, size_t count) { … }
bool PuffinStream::SetExtraByte() { … }
bool PuffinStream::GetPuffCache(int puff_id,
uint64_t puff_size,
shared_ptr<Buffer>* buffer) { … }
}