#pragma once

#include "AbstractEncoder.h"
#include "DeflateElements.h"

#include <vector>
#include <memory>

class DeflateBlock;

class DeflateEncoder : public AbstractEncoder
{
public:
    DeflateEncoder(BitStream* inputStream, BitStream* outputStream);

    ~DeflateEncoder();

    bool encode() override;

    bool decode() override;

    void setCompressionMethod(Deflate::CompressionMethod method)
    {
        mCompressionMethod = method;
    }

private:
    uint16_t mMaxBlockSize{65535};
    Deflate::CompressionMethod mCompressionMethod{Deflate::CompressionMethod::NONE};
    std::unique_ptr<DeflateBlock > mLastBlock;
};


