<commit_before>#include "psrdada_cpp/dada_output_stream.hpp"

namespace psrdada_cpp {

    DadaOutputStream::DadaOutputStream(key_t key, MultiLog& log)
    : _writer(key,log)
    {
    }

    DadaOutputStream::~DadaOutputStream()
    {
    }

    DadaWriteClient const& DadaOutputStream::client() const
    {
        return _writer;
    }

    void DadaOutputStream::init(RawBytes& in)
    {
        _writer.reset();
        auto& stream = _writer.header_stream();
        auto& buffer = stream.next();
        memcpy(in.ptr(),buffer.ptr(),in.used_bytes());
        stream.release();
    }

    void DadaOutputStream::operator()(RawBytes& in)
    {
        auto& stream = _writer.data_stream();
        auto& out = stream.next();
        memcpy(in.ptr(),out.ptr(),in.used_bytes());
        stream.release();
    }

} //psrdada_cpp<commit_msg>set used bytes on output streamer<commit_after>#include "psrdada_cpp/dada_output_stream.hpp"

namespace psrdada_cpp {

    DadaOutputStream::DadaOutputStream(key_t key, MultiLog& log)
    : _writer(key,log)
    {
    }

    DadaOutputStream::~DadaOutputStream()
    {
    }

    DadaWriteClient const& DadaOutputStream::client() const
    {
        return _writer;
    }

    void DadaOutputStream::init(RawBytes& in)
    {
        _writer.reset();
        auto& stream = _writer.header_stream();
        auto& buffer = stream.next();
        memcpy(in.ptr(),buffer.ptr(),in.used_bytes());
        buffer.used_bytes(in.used_bytes());
        stream.release();
    }

    void DadaOutputStream::operator()(RawBytes& in)
    {
        auto& stream = _writer.data_stream();
        auto& out = stream.next();
        memcpy(in.ptr(),out.ptr(),in.used_bytes());
        out.used_bytes(in.used_bytes());
        stream.release();
    }

} //psrdada_cpp
{'fraction_non_alphanumeric': 0.14086081609837897, 'fraction_numerical': 0.0, 'mean_word_length': 2.7605042016806722, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3615256', 'n_tokens_mistral': 575, 'n_tokens_neox': 566, 'n_words': 86}