Write bytes into the buffered filter, which will them emit them in calls to buffered_block in the subclass
34 {
35 if(!input_size) {
36 return;
37 }
38
39 if(m_buffer_pos + input_size >= m_main_block_mod + m_final_minimum) {
40 size_t to_copy = std::min<size_t>(m_buffer.size() - m_buffer_pos, input_size);
41
42 copy_mem(&m_buffer[m_buffer_pos], input, to_copy);
43 m_buffer_pos += to_copy;
44
45 input += to_copy;
46 input_size -= to_copy;
47
48 const size_t available = std::min(m_buffer_pos, m_buffer_pos + input_size - m_final_minimum);
49
50
51 const size_t total_to_consume = available - (available % m_main_block_mod);
52
54
55 m_buffer_pos -= total_to_consume;
56
57 copy_mem(m_buffer.data(), m_buffer.data() + total_to_consume, m_buffer_pos);
58 }
59
60 if(input_size >= m_final_minimum) {
61 size_t full_blocks = (input_size - m_final_minimum) / m_main_block_mod;
62 size_t to_copy = full_blocks * m_main_block_mod;
63
64 if(to_copy) {
66
67 input += to_copy;
68 input_size -= to_copy;
69 }
70 }
71
72 copy_mem(&m_buffer[m_buffer_pos], input, input_size);
73 m_buffer_pos += input_size;
74}
constexpr void copy_mem(T *out, const T *in, size_t n)