#ifndef TILE_BASE_BUFFER_COMPRESSION_OUTPUT_STREAM_H
#define TILE_BASE_BUFFER_COMPRESSION_OUTPUT_STREAM_H

#pragma once

#include "tile/base/compression/compression.h"

namespace tile {
class NoncontiguousBufferCompressionOutputStream : public CompressionOutputStream {
public:
    explicit NoncontiguousBufferCompressionOutputStream(NoncontiguousBufferBuilder *builder);
    ~NoncontiguousBufferCompressionOutputStream() override;

    void Flush();

    bool Next(void **data, std::size_t *size) noexcept override;
    void BackUp(std::size_t count) noexcept override;

private:
    std::size_t using_bytes_{};
    NoncontiguousBufferBuilder *builder_;
};
}// namespace tile

#endif// TILE_BASE_BUFFER_COMPRESSION_OUTPUT_STREAM_H
