mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2025-02-26 08:22:31 +00:00
bit_reader_c/bit_writer_c: add constructors taking memory_c
This commit is contained in:
parent
65870e15af
commit
175f043ed1
@ -38,6 +38,10 @@ public:
|
||||
init(data, len);
|
||||
}
|
||||
|
||||
reader_c(memory_c &data) {
|
||||
init(data.get_buffer(), data.get_size());
|
||||
}
|
||||
|
||||
void init(const unsigned char *data, std::size_t len) {
|
||||
m_end_of_data = data + len;
|
||||
m_byte_position = data;
|
||||
|
@ -41,6 +41,13 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
writer_c(memory_c &data)
|
||||
: m_data{data.get_buffer()}
|
||||
, m_size{data.get_size()}
|
||||
, m_data_size{data.get_size()}
|
||||
{
|
||||
}
|
||||
|
||||
inline memory_cptr get_buffer() {
|
||||
return memory_c::clone(m_data, m_size);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user