Luna::IStream
Represents a serial stream sequence of bytes and supports read/write operations on them.
interface Luna::IStream : public virtual Interface
Common implementations of streams include file, memory buffer, web socket and so on.
This object is not thread safe and the I/O operations on this object is not asynchronous (will suspend the current thread until the operation is done or failed).
Base type
Member functions
-
virtual RV read(void buffer, usize size, usize read_bytes=nullptr)=0
Reads data from the current position the cursor is pointing to and advances the cursor.
-
virtual RV write(const void buffer, usize size, usize write_bytes=nullptr)=0
Writes data to the current position the cursor is pointing to and advances the cursor.