Input stream based on AByteBuffer with memory control, clears byte buffer on destruction.
#include <AUI/IO/AStrongByteBufferInputStream.h>
|
|
| AStrongByteBufferInputStream (AByteBuffer buffer) noexcept |
| |
|
| AStrongByteBufferInputStream (_< AByteBuffer > buffer) noexcept |
| |
| bool | isEof () override |
| | returns true if end of stream has been reached
|
| |
| void | seek (std::streamoff offset, ASeekDir seekDir) override |
| | change reading position, a way of changing depends on seekDir parameter
|
| |
| std::streampos | tell () noexcept override |
| | return current reading position
|
| |
| size_t | read (char *dst, size_t size) override |
| | Reads up to size bytes from stream. Blocking (waiting for new data) is allowed.
|
| |
|
AByteBuffer & | buffer () noexcept |
| |
| size_t | fileSize () |
| | return size of the stream
|
| |
| size_t | read (std::span< std::byte > destination) |
| | Reads up to destination.size() bytes from stream. Blocking (waiting for new data) is allowed.
|
| |
| void | readExact (char *dst, size_t size) |
| | Reads exact size bytes from stream. Blocking (waiting for new data) is allowed.
|
| |
| template<typename T> |
| T | deserialize () |
| |
| template<typename T> |
| IInputStream & | operator>> (T &dst) |
| |
| template<typename T> |
| IInputStream & | operator>> (T &&dst) |
| |
◆ isEof()#
| bool AStrongByteBufferInputStream::isEof |
( |
| ) |
|
|
overridevirtual |
◆ read()#
| size_t AStrongByteBufferInputStream::read |
( |
char * | dst, |
|
|
size_t | size ) |
|
overridevirtual |
- Sneaky exceptions
- An implementation can throw any exception that subclasses AIOException.
- Parameters
-
| dst | destination buffer |
| size | destination buffer's size. > 0 |
- Returns
- number of read bytes (including 0)
Implements IInputStream.
◆ seek()#
| void AStrongByteBufferInputStream::seek |
( |
std::streamoff | offset, |
|
|
ASeekDir | seekDir ) |
|
overridevirtual |
◆ tell()#
| std::streampos AStrongByteBufferInputStream::tell |
( |
| ) |
|
|
nodiscardoverridevirtualnoexcept |