6#ifndef OPENCBDC_TX_SRC_SERIALIZATION_OSTREAM_SERIALIZER_H_
7#define OPENCBDC_TX_SRC_SERIALIZATION_OSTREAM_SERIALIZER_H_
39 auto write(
const void* data,
size_t len) ->
bool final;
43 auto read(
void* data,
size_t len) ->
bool final;
48 using off_type = std::remove_reference_t<
decltype(m_str)>::off_type;
Implementation of serializer for writing to a std::ostream.
auto write(const void *data, size_t len) -> bool final
Attempts to write the given number of bytes from the given memory location to the stream's current po...
void advance_cursor(size_t len) final
Moves the stream forward without writing to the stream.
ostream_serializer(std::ostream &s)
Constructor.
void reset() final
Seeks the stream position to the beginning.
auto end_of_buffer() const -> bool final
Indicates whether the serializer has reached the end of the stream.
auto read(void *data, size_t len) -> bool final
Not implemented for ostream.
Implementation of serializer for std::ios.