Skip to content

IInputStream#

Represents an input stream.

Header:#include <AUI/IO/IInputStream.h>
CMake:aui_link(my_target PUBLIC aui::core)

Public Methods#

deserialize#


template<typename T >
T IInputStream::deserialize()
Returns
result value

Reads data using AUI serialization (see AUI/Traits/serializable.h)

read#


virtual size_t IInputStream::read(char* dst, size_t size)

Reads up to size bytes from stream. Blocking (waiting for new data) is allowed.

Sneaky exceptions
An implementation can throw any exception that subclasses AIOException.
Arguments
dst
destination buffer
size
destination buffer's size. > 0
Returns
number of read bytes (including 0)

size_t IInputStream::read(std::span<std::byte> destination)

Reads up to destination.size() bytes from stream. Blocking (waiting for new data) is allowed.

Sneaky exceptions
An implementation can throw any exception that subclasses AIOException.
Arguments
destination
destination buffer
Returns
number of read bytes (including 0)

readExact#


void IInputStream::readExact(char* dst, size_t size)

Reads exact size bytes from stream. Blocking (waiting for new data) is allowed.

Sneaky exceptions
An implementation can throw any exception that subclasses AIOException.
Arguments
dst
destination buffer.
size
destination buffer's size.